Rename test base class

This commit is contained in:
Timothy Warren 2017-02-15 16:40:18 -05:00
parent 84cb1cb520
commit ee2760b2b5
18 changed files with 35 additions and 38 deletions

View File

@ -17,9 +17,9 @@
namespace Aviat\AnimeClient\Tests\API; namespace Aviat\AnimeClient\Tests\API;
use Aviat\AnimeClient\API\CacheTrait; use Aviat\AnimeClient\API\CacheTrait;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
class CacheTraitTest extends AnimeClient_TestCase { class CacheTraitTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@ -17,16 +17,16 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
use Aviat\Ion\Friend; use Aviat\Ion\Friend;
use Aviat\Ion\Json; use Aviat\Ion\Json;
class AnimeListTransformerTest extends AnimeClient_TestCase { class AnimeListTransformerTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
$this->dir = AnimeClient_TestCase::TEST_DATA_DIR . '/Kitsu'; $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu';
$this->beforeTransform = Json::decodeFile("{$this->dir}/animeListItemBeforeTransform.json"); $this->beforeTransform = Json::decodeFile("{$this->dir}/animeListItemBeforeTransform.json");
$this->afterTransform = Json::decodeFile("{$this->dir}/animeListItemAfterTransform.json"); $this->afterTransform = Json::decodeFile("{$this->dir}/animeListItemAfterTransform.json");

View File

@ -17,16 +17,16 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer; namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
use Aviat\Ion\Friend; use Aviat\Ion\Friend;
use Aviat\Ion\Json; use Aviat\Ion\Json;
class AnimeTransformerTest extends AnimeClient_TestCase { class AnimeTransformerTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
$this->dir = AnimeClient_TestCase::TEST_DATA_DIR . '/Kitsu'; $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu';
$this->beforeTransform = Json::decodeFile("{$this->dir}/animeBeforeTransform.json"); $this->beforeTransform = Json::decodeFile("{$this->dir}/animeBeforeTransform.json");
$this->afterTransform = Json::decodeFile("{$this->dir}/animeAfterTransform.json"); $this->afterTransform = Json::decodeFile("{$this->dir}/animeAfterTransform.json");

View File

@ -18,15 +18,15 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\JsonAPI;
use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
use Aviat\Ion\Json; use Aviat\Ion\Json;
class MangaListTransformerTest extends AnimeClient_TestCase { class MangaListTransformerTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
$this->dir = AnimeClient_TestCase::TEST_DATA_DIR . '/Kitsu'; $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu';
$rawBefore = Json::decodeFile("{$this->dir}/mangaListBeforeTransform.json"); $rawBefore = Json::decodeFile("{$this->dir}/mangaListBeforeTransform.json");
$this->beforeTransform = JsonAPI::inlineRawIncludes($rawBefore, 'manga'); $this->beforeTransform = JsonAPI::inlineRawIncludes($rawBefore, 'manga');

View File

@ -18,15 +18,15 @@ namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use Aviat\AnimeClient\API\JsonAPI; use Aviat\AnimeClient\API\JsonAPI;
use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer; use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
use Aviat\Ion\Json; use Aviat\Ion\Json;
class MangaTransformerTest extends AnimeClient_TestCase { class MangaTransformerTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
$this->dir = AnimeClient_TestCase::TEST_DATA_DIR . '/Kitsu'; $this->dir = AnimeClientTestCase::TEST_DATA_DIR . '/Kitsu';
$data = Json::decodeFile("{$this->dir}/mangaBeforeTransform.json"); $data = Json::decodeFile("{$this->dir}/mangaBeforeTransform.json");
$baseData = $data['data'][0]['attributes']; $baseData = $data['data'][0]['attributes'];

View File

@ -2,7 +2,7 @@
namespace Aviat\AnimeClient\Tests; namespace Aviat\AnimeClient\Tests;
class AnimeClientTest extends AnimeClient_TestCase { class AnimeClientTest extends AnimeClientTestCase {
/** /**
* Basic sanity test for _dir function * Basic sanity test for _dir function
*/ */

View File

@ -20,7 +20,7 @@ define('TEST_VIEW_DIR', __DIR__ . '/test_views');
/** /**
* Base class for TestCases * Base class for TestCases
*/ */
class AnimeClient_TestCase extends TestCase { class AnimeClientTestCase extends TestCase {
// Test directory constants // Test directory constants
const ROOT_DIR = ROOT_DIR; const ROOT_DIR = ROOT_DIR;
const SRC_DIR = SRC_DIR; const SRC_DIR = SRC_DIR;
@ -160,4 +160,4 @@ class AnimeClient_TestCase extends TestCase {
return Json::decode($rawData); return Json::decode($rawData);
} }
} }
// End of AnimeClient_TestCase.php // End of AnimeClientTestCase.php

View File

@ -17,11 +17,11 @@
namespace Aviat\AnimeClient\Tests\Command; namespace Aviat\AnimeClient\Tests\Command;
use Aviat\AnimeClient\Command\BaseCommand; use Aviat\AnimeClient\Command\BaseCommand;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase; use Aviat\AnimeClient\Tests\AnimeClientTestCase;
use Aviat\Ion\Friend; use Aviat\Ion\Friend;
use ConsoleKit\Console; use ConsoleKit\Console;
class BaseCommandTest extends AnimeClient_TestCase { class BaseCommandTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {
$this->base = new BaseCommand(new Console()); $this->base = new BaseCommand(new Console());

View File

@ -11,7 +11,7 @@ use Aviat\AnimeClient\Controller\{
Manga as MangaController Manga as MangaController
}; };
class ControllerTest extends AnimeClient_TestCase { class ControllerTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {

View File

@ -9,7 +9,7 @@ use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
class DispatcherTest extends AnimeClient_TestCase { class DispatcherTest extends AnimeClientTestCase {
protected $container; protected $container;
protected $router; protected $router;

View File

@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\Helper\Menu as MenuHelper; use Aviat\AnimeClient\Helper\Menu as MenuHelper;
class MenuHelperTest extends AnimeClient_TestCase { class MenuHelperTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {

View File

@ -5,7 +5,7 @@ namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\MenuGenerator; use Aviat\AnimeClient\MenuGenerator;
use Aviat\Ion\Friend; use Aviat\Ion\Friend;
class MenuGeneratorTest extends AnimeClient_TestCase { class MenuGeneratorTest extends AnimeClientTestCase {
protected $generator; protected $generator;
protected $friend; protected $friend;

View File

@ -4,7 +4,7 @@ namespace Aviat\AnimeClient\Tests;
use PDO; use PDO;
class RequirementsTest extends AnimeClient_TestCase { class RequirementsTest extends AnimeClientTestCase {
public function testPHPVersion() public function testPHPVersion()
{ {

View File

@ -4,7 +4,7 @@ namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\RoutingBase; use Aviat\AnimeClient\RoutingBase;
class RoutingBaseTest extends AnimeClient_TestCase { class RoutingBaseTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {

View File

@ -5,7 +5,7 @@ namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\UrlGenerator; use Aviat\AnimeClient\UrlGenerator;
use Aviat\Ion\Config; use Aviat\Ion\Config;
class UrlGeneratorTest extends AnimeClient_TestCase { class UrlGeneratorTest extends AnimeClientTestCase {
public function assetUrlProvider() public function assetUrlProvider()
{ {

View File

@ -4,7 +4,7 @@ namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\Util; use Aviat\AnimeClient\Util;
class UtilTest extends AnimeClient_TestCase { class UtilTest extends AnimeClientTestCase {
public function setUp() public function setUp()
{ {

View File

@ -30,7 +30,7 @@ function _dir()
// Autoloading // Autoloading
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
require _dir(__DIR__, 'AnimeClient_TestCase.php'); require _dir(__DIR__, 'AnimeClientTestCase.php');
require _dir(__DIR__, '../vendor/autoload.php'); require _dir(__DIR__, '../vendor/autoload.php');
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View File

@ -3,18 +3,15 @@
* All the mock classes that extend the classes they are used to test * All the mock classes that extend the classes they are used to test
*/ */
use Aviat\AnimeClient\Model\Anime as AnimeModel; use Aviat\AnimeClient\Model\{
use Aviat\AnimeClient\Model\API as BaseApiModel; Anime as AnimeModel,
use Aviat\AnimeClient\Model\Manga as MangaModel; API as BaseApiModel,
use Aviat\Ion\Enum; Manga as MangaModel
use Aviat\Ion\Friend; };
use Aviat\Ion\Json; use Aviat\Ion\{Enum, Friend, Json};
use Aviat\Ion\Transformer\AbstractTransformer; use Aviat\Ion\Transformer\AbstractTransformer;
use Aviat\Ion\View; use Aviat\Ion\View;
use Aviat\Ion\View\HtmlView; use Aviat\Ion\View\{HtmlView, HttpView, JsonView};
use Aviat\Ion\View\HttpView;
use Aviat\Ion\View\JsonView;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Mock the default error handler // Mock the default error handler