Simplify test setup

This commit is contained in:
Timothy Warren 2017-03-24 16:57:27 -04:00
parent 4c3b75c3d6
commit 3345ed069f
4 changed files with 8 additions and 26 deletions

View File

@ -16,12 +16,10 @@
namespace Aviat\Ion\Tests; namespace Aviat\Ion\Tests;
use function Aviat\Ion\_dir;
use Aura\Web\WebFactory; use Aura\Web\WebFactory;
use Aviat\Ion\Json; use Aviat\Ion\Json;
use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Zend\Diactoros\ServerRequestFactory; use Zend\Diactoros\ServerRequestFactory;
use Zend\Diactoros\Response as HttpResponse; use Zend\Diactoros\Response as HttpResponse;

View File

@ -16,6 +16,8 @@
namespace Aviat\Ion\Tests; namespace Aviat\Ion\Tests;
use function Aviat\Ion\_dir;
use Aviat\Ion\{Json, JsonException}; use Aviat\Ion\{Json, JsonException};
class JsonTest extends Ion_TestCase { class JsonTest extends Ion_TestCase {

View File

@ -16,9 +16,9 @@
namespace Aviat\Ion\Tests\View; namespace Aviat\Ion\Tests\View;
use Aviat\Ion\Tests\TestHtmlView; use function Aviat\Ion\_dir;
use function _dir; use Aviat\Ion\Tests\TestHtmlView;
class HtmlViewTest extends HttpViewTest { class HtmlViewTest extends HttpViewTest {

View File

@ -10,30 +10,12 @@ if ($timezone === '' || $timezone === FALSE)
ini_set('date.timezone', 'GMT'); ini_set('date.timezone', 'GMT');
} }
// -----------------------------------------------------------------------------
// Global functions
// -----------------------------------------------------------------------------
/**
* Joins paths together. Variadic to take an
* arbitrary number of arguments
*
* @return string
*/
function _dir()
{
return implode(DIRECTORY_SEPARATOR, func_get_args());
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Autoloading // Autoloading
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
require 'Ion_TestCase.php';
// Composer autoload // Composer autoload
require __DIR__ . '/../vendor/autoload.php'; require realpath(__DIR__ . '/../vendor/autoload.php');
require 'Ion_TestCase.php';
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Ini Settings // Ini Settings