cleaned up some unit test requires

pull/501/head
n0nag0n 1 year ago
parent ccdca7e180
commit 9faf27262c

@ -43,10 +43,18 @@
}
},
"scripts": {
"test": "phpunit tests",
"test": "phpunit",
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage",
"lint": "phpstan --no-progress -cphpstan.neon"
},
"suggest": {
"phpstan/phpstan": "PHP Static Analysis Tool"
}
"phpstan/phpstan": "PHP Static Analysis Tool",
"latte/latte": "Latte template engine"
},
"suggest-dev": {
"tracy/tracy": "Tracy debugger"
},
"replace": {
"mikecao/flight": "2.0.2"
}
}

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="tests/phpunit_autoload.php"
executionOrder="random"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"

@ -8,9 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class AutoloadTest extends PHPUnit\Framework\TestCase
{
/**

@ -8,9 +8,6 @@
use flight\core\Dispatcher;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/classes/Hello.php';
class DispatcherTest extends PHPUnit\Framework\TestCase
{
/**

@ -8,9 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class FilterTest extends PHPUnit\Framework\TestCase
{
/**

@ -11,9 +11,6 @@ use flight\template\View;
* @copyright Copyright (c) 2012, Mike Cao <mike@mikecao.com>
* @license MIT, http://flightphp.com/license
*/
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/Flight.php';
class FlightTest extends PHPUnit\Framework\TestCase
{
protected function setUp(): void

@ -8,7 +8,6 @@
use flight\core\Loader;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/classes/User.php';
require_once __DIR__ . '/classes/Factory.php';

@ -8,8 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
require_once __DIR__ . '/classes/Hello.php';
class MapTest extends PHPUnit\Framework\TestCase

@ -8,9 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class RedirectTest extends PHPUnit\Framework\TestCase
{
private Engine $app;

@ -8,8 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
require_once __DIR__ . '/classes/User.php';
class RegisterTest extends PHPUnit\Framework\TestCase

@ -8,9 +8,6 @@
use flight\Engine;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/Flight.php';
class RenderTest extends PHPUnit\Framework\TestCase
{
private Engine $app;

@ -8,9 +8,6 @@
use flight\net\Request;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class RequestTest extends PHPUnit\Framework\TestCase
{
private Request $request;

@ -10,9 +10,6 @@ use flight\core\Dispatcher;
use flight\net\Request;
use flight\net\Router;
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class RouterTest extends PHPUnit\Framework\TestCase
{
private Router $router;

@ -5,9 +5,6 @@
* @copyright Copyright (c) 2012, Mike Cao <mike@mikecao.com>
* @license MIT, http://flightphp.com/license
*/
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class VariableTest extends PHPUnit\Framework\TestCase
{
/**

@ -5,9 +5,6 @@
* @copyright Copyright (c) 2012, Mike Cao <mike@mikecao.com>
* @license MIT, http://flightphp.com/license
*/
require_once 'vendor/autoload.php';
require_once __DIR__ . '/../flight/autoload.php';
class ViewTest extends PHPUnit\Framework\TestCase
{
/**

@ -0,0 +1,6 @@
<?php
$path = file_exists(__DIR__ . '/../vendor/autoload.php')
? __DIR__ . '/../vendor/autoload.php'
: __DIR__ . '/../flight/autoload.php';
require_once($path);
Loading…
Cancel
Save