Properly namespace all the tests

This commit is contained in:
Timothy Warren 2017-02-15 11:49:38 -05:00
parent e5db6bebe8
commit 30b398c946
18 changed files with 47 additions and 21 deletions

View File

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

View File

@ -16,8 +16,8 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use AnimeClient_TestCase;
use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeListTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase;
use Aviat\Ion\Friend;
use Aviat\Ion\Json;

View File

@ -16,8 +16,8 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use AnimeClient_TestCase;
use Aviat\AnimeClient\API\Kitsu\Transformer\AnimeTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase;
use Aviat\Ion\Friend;
use Aviat\Ion\Json;

View File

@ -16,9 +16,9 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use AnimeClient_TestCase;
use Aviat\AnimeClient\API\JsonAPI;
use Aviat\AnimeClient\API\Kitsu\Transformer\MangaListTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase;
use Aviat\Ion\Json;
class MangaListTransformerTest extends AnimeClient_TestCase {

View File

@ -16,9 +16,9 @@
namespace Aviat\AnimeClient\Tests\API\Kitsu\Transformer;
use AnimeClient_TestCase;
use Aviat\AnimeClient\API\JsonAPI;
use Aviat\AnimeClient\API\Kitsu\Transformer\MangaTransformer;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase;
use Aviat\Ion\Json;
class MangaTransformerTest extends AnimeClient_TestCase {

View File

@ -1,13 +1,13 @@
<?php
namespace Aviat\AnimeClient\Tests;
class AnimeClientTest extends AnimeClient_TestCase {
/**
* Basic sanity test for _dir function
*/
public function testDir()
{
$this->assertEquals('foo' . DIRECTORY_SEPARATOR . 'bar', \_dir('foo', 'bar'));
$this->assertEquals('foo' . \DIRECTORY_SEPARATOR . 'bar', \_dir('foo', 'bar'));
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use const Aviat\AnimeClient\SRC_DIR;
use Aura\Web\WebFactory;

View File

@ -1,6 +1,9 @@
<?php
namespace Aviat\AnimeClient\Tests\Command;
use Aviat\AnimeClient\Command\BaseCommand;
use Aviat\AnimeClient\Tests\AnimeClient_TestCase;
use Aviat\Ion\Friend;
use ConsoleKit\Console;

View File

@ -1,4 +1,7 @@
<?php declare(strict_types=1);
namespace Aviat\AnimeClient\Tests;
use Aura\Router\RouterFactory;
use Aura\Web\WebFactory;
use Aviat\AnimeClient\Controller;

View File

@ -1,5 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\Dispatcher;
use Aviat\AnimeClient\UrlGenerator;
use Aviat\Ion\Config;
@ -53,7 +55,7 @@ class DispatcherTest extends AnimeClient_TestCase {
public function dataRoute()
{
$default_config = array(
$default_config = [
'routes' => [
'routes' => [
'login_form' => [
@ -88,33 +90,33 @@ class DispatcherTest extends AnimeClient_TestCase {
'default_list' => 'anime'
]
],
);
];
$data = [
'anime_default_routing_manga' => array(
'anime_default_routing_manga' => [
'config' => $default_config,
'controller' => 'manga',
'host' => "localhost",
'uri' => "/manga/plan_to_read",
),
'manga_default_routing_anime' => array(
],
'manga_default_routing_anime' => [
'config' => $default_config,
'controller' => 'anime',
'host' => "localhost",
'uri' => "/anime/watching",
),
'anime_default_routing_anime' => array(
],
'anime_default_routing_anime' => [
'config' => $default_config,
'controller' => 'anime',
'host' => 'localhost',
'uri' => '/anime/watching',
),
'manga_default_routing_manga' => array(
],
'manga_default_routing_manga' => [
'config' => $default_config,
'controller' => 'manga',
'host' => 'localhost',
'uri' => '/manga/plan_to_read'
)
]
];
$data['manga_default_routing_anime']['config']['routes']['route_config']['default_list'] = 'manga';

View File

@ -1,5 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\Helper\Menu as MenuHelper;
class MenuHelperTest extends AnimeClient_TestCase {

View File

@ -1,4 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\MenuGenerator;
use Aviat\Ion\Friend;

View File

@ -1,5 +1,9 @@
<?php
namespace Aviat\AnimeClient\Tests;
use PDO;
class RequirementsTest extends AnimeClient_TestCase {
public function testPHPVersion()

View File

@ -1,5 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\RoutingBase;
class RoutingBaseTest extends AnimeClient_TestCase {

View File

@ -1,6 +1,8 @@
<?php
class TestSessionHandler implements SessionHandlerInterface {
namespace Aviat\AnimeClient\Tests;
class TestSessionHandler implements \SessionHandlerInterface {
public $data = [];
public $save_path = './test_data/sessions';

View File

@ -1,5 +1,7 @@
<?php
namespace Aviat\AnimeClient\Tests;
use Aviat\AnimeClient\UrlGenerator;
use Aviat\Ion\Config;

View File

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

View File

@ -37,8 +37,8 @@ require _dir(__DIR__, '../vendor/autoload.php');
// Ini Settings
// -----------------------------------------------------------------------------
ini_set('session.use_cookies', 0);
ini_set("session.use_only_cookies",0);
ini_set("session.use_trans_sid",1);
ini_set("session.use_only_cookies", 0);
ini_set("session.use_trans_sid", 1);
// Start session here to supress error about headers not sent
session_start();