cleaned up some unit test requires

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

@ -43,10 +43,18 @@
} }
}, },
"scripts": { "scripts": {
"test": "phpunit tests", "test": "phpunit",
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage",
"lint": "phpstan --no-progress -cphpstan.neon" "lint": "phpstan --no-progress -cphpstan.neon"
}, },
"suggest": { "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"?> <?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" <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" executionOrder="random"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"

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

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

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

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

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

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

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

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

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

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

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

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

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