Skip to content
Permalink
Browse files

Refactor tests to fix new pattern

  • Loading branch information...
supergrecko committed Jun 22, 2019
1 parent d674b92 commit 04e237e3ec5343ca43ffae6d4685a1a974e7b6f1
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.1/phpunit.xsd"
bootstrap="vendor/autoload.php"
bootstrap="tests/autoload.php"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
@@ -3,12 +3,9 @@
namespace RiotQuest\Tests\Collections;
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Components\Collections\Collection;
use RiotQuest\Components\Collections\Match;
Client::boot();
/**
* Class CollectionTest
* @package RiotQuest\Tests\Collections
@@ -5,19 +5,19 @@
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Components\Collections\ChampionInfo;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class ChampionTest
* @package RiotQuest\Tests\Endpoints
*/
class ChampionTest extends TestCase
{
/**
* Test the champion rotations endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestRotation()
{
@@ -4,19 +4,19 @@
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class CodeTest
* @package RiotQuest\Tests\Endpoints
*/
class CodeTest extends TestCase
{
/**
* Assert that the code endpoint works
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestCode()
{
@@ -6,19 +6,19 @@
use RiotQuest\Client;
use RiotQuest\Components\Collections\League;
use RiotQuest\Components\Collections\LeagueEntryList;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class LeagueTest
* @package RiotQuest\Tests\Endpoints
*/
class LeagueTest extends TestCase
{
/**
* Test the single league ID endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestSingleLeague()
{
@@ -28,6 +28,9 @@ public function testRequestSingleLeague()
$this->assertInstanceOf(League::class, $collection);
}
/**
* @throws LeagueException
*/
public function testLeagueEntries() {
$collection = Client::league('euw')->entries('RANKED_SOLO_5x5', 'DIAMOND', 'I', 1);
@@ -37,10 +40,7 @@ public function testLeagueEntries() {
/**
* Test the apex league endpoints
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestApexLeagues()
{
@@ -56,10 +56,7 @@ public function testRequestApexLeagues()
/**
* Test positions for summoner endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestPositions()
{
@@ -6,19 +6,19 @@
use RiotQuest\Client;
use RiotQuest\Components\Collections\ChampionMastery;
use RiotQuest\Components\Collections\ChampionMasteryList;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class MasteryTest
* @package RiotQuest\Tests\Endpoints
*/
class MasteryTest extends TestCase
{
/**
* Tests the all masteries endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestAllMasteries()
{
@@ -31,10 +31,7 @@ public function testRequestAllMasteries()
/**
* Tests the single mastery endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestSingleMastery()
{
@@ -47,10 +44,7 @@ public function testRequestSingleMastery()
/**
* Test total mastery score endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestTotalScore()
{
@@ -7,19 +7,19 @@
use RiotQuest\Components\Collections\Match;
use RiotQuest\Components\Collections\MatchHistory;
use RiotQuest\Components\Collections\MatchTimeline;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class MatchTest
* @package RiotQuest\Tests\Endpoints
*/
class MatchTest extends TestCase
{
/**
* Tests match by id endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestSingleId()
{
@@ -32,10 +32,7 @@ public function testRequestSingleId()
/**
* Tests the match history endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestMatchList()
{
@@ -48,10 +45,7 @@ public function testRequestMatchList()
/**
* Tests the match timeline endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestTimeline()
{
@@ -8,18 +8,17 @@
use RiotQuest\Components\Collections\FeaturedGames;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class SpectatorTest
* @package RiotQuest\Tests\Endpoints
*/
class SpectatorTest extends TestCase
{
/**
* Tests the featured games endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestFeaturedGames()
{
@@ -30,10 +29,6 @@ public function testRequestFeaturedGames()
/**
* Tests the live game endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
*/
public function testRequestActiveGame()
{
@@ -5,19 +5,19 @@
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Components\Collections\ShardStatus;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class StatusTest
* @package RiotQuest\Tests\Endpoints
*/
class StatusTest extends TestCase
{
/**
* Test the status endpoint
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestShard()
{
@@ -5,19 +5,19 @@
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Components\Collections\Summoner;
use RiotQuest\Contracts\LeagueException;
Client::boot();
/**
* Class SummonerTest
* @package RiotQuest\Tests\Endpoints
*/
class SummonerTest extends TestCase
{
/**
* Makes sure that the summoner by name endpoint works
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestByName()
{
@@ -30,10 +30,7 @@ public function testRequestByName()
/**
* Make sure that the summoner by summoner id works
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestById()
{
@@ -46,10 +43,7 @@ public function testRequestById()
/**
* Make sure that the summoner by account id endpoint works
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestByAccount()
{
@@ -62,10 +56,7 @@ public function testRequestByAccount()
/**
* Make sure that the summoner by puuid endpoint works
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
* @throws LeagueException
*/
public function testRequestByUnique()
{
@@ -3,11 +3,12 @@
namespace RiotQuest\Tests\Framework;
use PHPUnit\Framework\TestCase;
use RiotQuest\Client;
use RiotQuest\Components\Engine\Utils;
Client::boot();
/**
* Class LibraryTest
* @package RiotQuest\Tests\Framework
*/
class LibraryTest extends TestCase
{
@@ -0,0 +1,9 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
/** @noinspection PhpUnhandledExceptionInspection */
require __DIR__ . '/../vendor/autoload.php';
use RiotQuest\Client;
/** @noinspection PhpUnhandledExceptionInspection */
Client::boot();

0 comments on commit 04e237e

Please sign in to comment.
You can’t perform that action at this time.