diff --git a/flight.sublime-project b/flight.sublime-project index e507ffa..ccca03f 100644 --- a/flight.sublime-project +++ b/flight.sublime-project @@ -41,7 +41,12 @@ { "name": "Linter - Default", "quiet": true, - "shell_cmd": "composer lint -- --no-ansi | composer phpcs -- --no-colors", + "shell_cmd": "composer lint -- --no-ansi & composer phpcs -- --no-colors", + }, + { + "name": "PHPCS", + "quiet": true, + "shell_cmd": "composer phpcs -- --no-colors" }, { "name": "Format", diff --git a/flight/Engine.php b/flight/Engine.php index c60192c..71ae8a5 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight; @@ -28,36 +21,46 @@ use flight\net\Route; * It is responsible for loading an HTTP request, running the assigned services, * and generating an HTTP response. * - * Core methods + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao * + * # Core methods * @method void start() Starts engine * @method void stop() Stops framework and outputs current response * @method void halt(int $code = 200, string $message = '') Stops processing and returns a given response. * - * Routing - * @method Route route(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a URL to a callback function with all applicable methods - * @method void group(string $pattern, callable $callback, array $group_middlewares = []) Groups a set of routes together under a common prefix. - * @method Route post(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a POST URL to a callback function. - * @method Route put(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a PUT URL to a callback function. - * @method Route patch(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a PATCH URL to a callback function. - * @method Route delete(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a DELETE URL to a callback function. + * # Routing + * @method Route route(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a URL to a callback function with all applicable methods + * @method void group(string $pattern, callable $callback, array $group_middlewares = []) + * Groups a set of routes together under a common prefix. + * @method Route post(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a POST URL to a callback function. + * @method Route put(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a PUT URL to a callback function. + * @method Route patch(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a PATCH URL to a callback function. + * @method Route delete(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a DELETE URL to a callback function. * @method Router router() Gets router * @method string getUrl(string $alias) Gets a url from an alias * - * Views + * # Views * @method void render(string $file, array $data = null, string $key = null) Renders template * @method View view() Gets current view * - * Request-response + * # Request-Response * @method Request request() Gets current request * @method Response response() Gets current response * @method void error(Throwable $e) Sends an HTTP 500 response for any errors. * @method void notFound() Sends an HTTP 404 response when a URL is not found. * @method void redirect(string $url, int $code = 303) Redirects the current request to another URL. - * @method void json(mixed $data, int $code = 200, bool $encode = true, string $charset = 'utf-8', int $option = 0) Sends a JSON response. - * @method void jsonp(mixed $data, string $param = 'jsonp', int $code = 200, bool $encode = true, string $charset = 'utf-8', int $option = 0) Sends a JSONP response. + * @method void json(mixed $data, int $code = 200, bool $encode = true, string $charset = 'utf-8', int $option = 0) + * Sends a JSON response. + * @method void jsonp(mixed $data, string $param = 'jsonp', int $code = 200, + * bool $encode = true, string $charset = 'utf-8', int $option = 0) Sends a JSONP response. * - * HTTP caching + * # HTTP caching * @method void etag($id, string $type = 'strong') Handles ETag HTTP caching. * @method void lastModified(int $time) Handles last modified HTTP caching. */ @@ -602,7 +605,6 @@ class Engine * * @param int $code HTTP status code * @param string $message Response message - * */ public function _halt(int $code = 200, string $message = ''): void { diff --git a/flight/Flight.php b/flight/Flight.php index ec139d8..f30fd32 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); use flight\core\Dispatcher; @@ -19,18 +12,29 @@ use flight\net\Route; /** * The Flight class is a static representation of the framework. + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao * + * # Core methods * @method static void start() Starts the framework. * @method static void path(string $path) Adds a path for autoloading classes. * @method static void stop() Stops the framework and sends a response. - * @method static void halt(int $code = 200, string $message = '') Stop the framework with an optional status code and message. + * @method static void halt(int $code = 200, string $message = '') + * Stop the framework with an optional status code and message. * - * @method static Route route(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Maps a URL pattern to a callback with all applicable methods. - * @method static void group(string $pattern, callable $callback, array $group_middlewares = []) Groups a set of routes together under a common prefix. - * @method static Route post(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a POST URL to a callback function. - * @method static Route put(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a PUT URL to a callback function. - * @method static Route patch(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a PATCH URL to a callback function. - * @method static Route delete(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') Routes a DELETE URL to a callback function. + * # Routing + * @method static Route route(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Maps a URL pattern to a callback with all applicable methods. + * @method static void group(string $pattern, callable $callback, array $group_middlewares = []) + * Groups a set of routes together under a common prefix. + * @method static Route post(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a POST URL to a callback function. + * @method static Route put(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a PUT URL to a callback function. + * @method static Route patch(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a PATCH URL to a callback function. + * @method static Route delete(string $pattern, callable $callback, bool $pass_route = false, string $alias = '') + * Routes a DELETE URL to a callback function. * @method static Router router() Returns Router instance. * @method static string getUrl(string $alias) Gets a url from an alias * @@ -44,17 +48,22 @@ use flight\net\Route; * @method static bool has($key) Checks if a variable is set. * @method static void clear($key = null) Clears a variable. * + * # Views * @method static void render($file, array $data = null, $key = null) Renders a template file. * @method static View view() Returns View instance. * + * # Request-Response * @method static Request request() Returns Request instance. * @method static Response response() Returns Response instance. * @method static void redirect($url, $code = 303) Redirects to another URL. - * @method static void json($data, $code = 200, $encode = true, $charset = "utf8", $encodeOption = 0, $encodeDepth = 512) Sends a JSON response. - * @method static void jsonp($data, $param = 'jsonp', $code = 200, $encode = true, $charset = "utf8", $encodeOption = 0, $encodeDepth = 512) Sends a JSONP response. + * @method static void json($data, $code = 200, $encode = true, $charset = "utf8", + * $encodeOption = 0, $encodeDepth = 512) Sends a JSON response. + * @method static void jsonp($data, $param = 'jsonp', $code = 200, $encode = true, + * $charset = "utf8", $encodeOption = 0, $encodeDepth = 512) Sends a JSONP response. * @method static void error($exception) Sends an HTTP 500 response. * @method static void notFound() Sends an HTTP 404 response. * + * # HTTP caching * @method static void etag($id, $type = 'strong') Performs ETag HTTP caching. * @method static void lastModified($time) Performs last modified HTTP caching. */ diff --git a/flight/autoload.php b/flight/autoload.php index 24f9643..3a7ea5a 100644 --- a/flight/autoload.php +++ b/flight/autoload.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); use flight\core\Loader; diff --git a/flight/core/Dispatcher.php b/flight/core/Dispatcher.php index 8bd51fa..1f55269 100644 --- a/flight/core/Dispatcher.php +++ b/flight/core/Dispatcher.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\core; @@ -19,6 +12,9 @@ use InvalidArgumentException; * are simply aliases for class methods or functions. The Dispatcher * allows you to hook other functions to an event that can modify the * input parameters and/or the output. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class Dispatcher { diff --git a/flight/core/Loader.php b/flight/core/Loader.php index e9ac837..046f8d8 100644 --- a/flight/core/Loader.php +++ b/flight/core/Loader.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\core; @@ -19,6 +12,9 @@ use Exception; * a list of reusable class instances and can generate a new class * instances with custom initialization parameters. It also performs * class autoloading. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class Loader { diff --git a/flight/database/PdoWrapper.php b/flight/database/PdoWrapper.php index ffa4c0c..87c930e 100644 --- a/flight/database/PdoWrapper.php +++ b/flight/database/PdoWrapper.php @@ -1,5 +1,7 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\net; @@ -18,6 +11,9 @@ use flight\util\Collection; * all the super globals $_GET, $_POST, $_COOKIE, and $_FILES * are stored and accessible via the Request object. * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao + * * The default request properties are: * * - **url** - The URL being requested diff --git a/flight/net/Response.php b/flight/net/Response.php index 0446c3d..7bef496 100644 --- a/flight/net/Response.php +++ b/flight/net/Response.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\net; @@ -17,11 +10,14 @@ use Exception; * The Response class represents an HTTP response. The object * contains the response headers, HTTP status code, and response * body. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class Response { /** - * header Content-Length. + * Content-Length header. */ public bool $content_length = true; diff --git a/flight/net/Route.php b/flight/net/Route.php index f65910a..bdf5827 100644 --- a/flight/net/Route.php +++ b/flight/net/Route.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\net; @@ -15,6 +8,9 @@ namespace flight\net; * The Route class is responsible for routing an HTTP request to * an assigned callback function. The Router tries to match the * requested URL against a series of URL patterns. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class Route { diff --git a/flight/net/Router.php b/flight/net/Router.php index 607942e..6f6300a 100644 --- a/flight/net/Router.php +++ b/flight/net/Router.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\net; @@ -18,6 +11,9 @@ use flight\net\Route; * The Router class is responsible for routing an HTTP request to * an assigned callback function. The Router tries to match the * requested URL against a series of URL patterns. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class Router { diff --git a/flight/template/View.php b/flight/template/View.php index d0c5f3b..dfd29ee 100644 --- a/flight/template/View.php +++ b/flight/template/View.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\template; @@ -15,6 +8,9 @@ namespace flight\template; * The View class represents output to be displayed. It provides * methods for managing view data and inserts the data into * view templates upon rendering. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao */ class View { diff --git a/flight/util/Collection.php b/flight/util/Collection.php index 3c1317c..0ede58a 100644 --- a/flight/util/Collection.php +++ b/flight/util/Collection.php @@ -1,12 +1,5 @@ - * @license MIT, http://flightphp.com/license - */ - declare(strict_types=1); namespace flight\util; @@ -19,6 +12,9 @@ use JsonSerializable; /** * The Collection class allows you to access a set of data * using both array and object notation. + * + * @license MIT, http://flightphp.com/license + * @copyright Copyright (c) 2011, Mike Cao * @implements ArrayAccess * @implements Iterator */ diff --git a/flight/util/ReturnTypeWillChange.php b/flight/util/ReturnTypeWillChange.php index 0a40639..df7c49f 100644 --- a/flight/util/ReturnTypeWillChange.php +++ b/flight/util/ReturnTypeWillChange.php @@ -1,4 +1,6 @@ - + Created with the PHP Coding Standard Generator. http://edorian.github.io/php-coding-standard-generator/ @@ -7,6 +10,27 @@ + + + + + + + + + + + + + + + + + + + + + flight/ tests/ diff --git a/tests/AutoloadTest.php b/tests/AutoloadTest.php index ac64474..54017e2 100644 --- a/tests/AutoloadTest.php +++ b/tests/AutoloadTest.php @@ -1,23 +1,16 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\Engine; use tests\classes\User; +use PHPUnit\Framework\TestCase; -class AutoloadTest extends \PHPUnit\Framework\TestCase +class AutoloadTest extends TestCase { - /** - * @var Engine - */ - private $app; + private Engine $app; protected function setUp(): void { diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index 5c8ae52..b6eac46 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -1,24 +1,19 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; -class CollectionTest extends \PHPUnit\Framework\TestCase +use flight\util\Collection; +use PHPUnit\Framework\TestCase; + +class CollectionTest extends TestCase { - /** - * @var \flight\util\Collection - */ - private $collection; + private Collection $collection; protected function setUp(): void { - $this->collection = new \flight\util\Collection(['a' => 1, 'b' => 2]); + $this->collection = new Collection(['a' => 1, 'b' => 2]); } // Get an item diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index 153890a..c3914b4 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -1,23 +1,16 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use Exception; use flight\core\Dispatcher; use tests\classes\Hello; +use PHPUnit\Framework\TestCase; -class DispatcherTest extends \PHPUnit\Framework\TestCase +class DispatcherTest extends TestCase { - /** - * @var Dispatcher|null - */ private Dispatcher $dispatcher; protected function setUp(): void @@ -135,7 +128,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase return "Hello, $name!"; }); - $this->dispatcher->hook('hello', 'before', function (&$params, &$output) { + $this->dispatcher->hook('hello', 'before', function (&$params) { // Manipulate the parameter $params[0] = 'Fred'; }); diff --git a/tests/EngineTest.php b/tests/EngineTest.php index b0b358b..0a20b53 100644 --- a/tests/EngineTest.php +++ b/tests/EngineTest.php @@ -1,11 +1,7 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); + namespace tests; use Exception; @@ -266,7 +262,7 @@ class EngineTest extends TestCase $this->assertEquals(200, $engine->response()->status()); } - public function testJsonPBadParam() + public function testJsonpBadParam() { $engine = new Engine(); $engine->jsonp(['key1' => 'value1', 'key2' => 'value2']); diff --git a/tests/FilterTest.php b/tests/FilterTest.php index a05fb13..0f34824 100644 --- a/tests/FilterTest.php +++ b/tests/FilterTest.php @@ -1,22 +1,15 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\Engine; +use PHPUnit\Framework\TestCase; -class FilterTest extends \PHPUnit\Framework\TestCase +class FilterTest extends TestCase { - /** - * @var Engine - */ - private $app; + private Engine $app; protected function setUp(): void { @@ -30,7 +23,7 @@ class FilterTest extends \PHPUnit\Framework\TestCase return "Hello, $name!"; }); - $this->app->before('hello', function (&$params, &$output) { + $this->app->before('hello', function (&$params) { // Manipulate the parameter $params[0] = 'Fred'; }); @@ -52,15 +45,15 @@ class FilterTest extends \PHPUnit\Framework\TestCase return "Bye, $name!"; }); - $this->app->before('bye', function (&$params, &$output) { + $this->app->before('bye', function (&$params) { $params[0] = 'Bob'; }); - $this->app->before('bye', function (&$params, &$output) { + $this->app->before('bye', function (&$params) { $params[0] = 'Fred'; return false; }); - $this->app->before('bye', function (&$params, &$output) { + $this->app->before('bye', function (&$params) { $params[0] = 'Ted'; }); diff --git a/tests/FlightTest.php b/tests/FlightTest.php index 939295c..2c964ff 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -1,24 +1,21 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use Exception; use Flight; + use flight\Engine; use flight\net\Request; use flight\net\Response; use flight\net\Router; use flight\template\View; use tests\classes\User; +use PHPUnit\Framework\TestCase; -class FlightTest extends \PHPUnit\Framework\TestCase +class FlightTest extends TestCase { protected function setUp(): void { diff --git a/tests/LoaderTest.php b/tests/LoaderTest.php index 4d1ab3f..44a89d0 100644 --- a/tests/LoaderTest.php +++ b/tests/LoaderTest.php @@ -1,11 +1,6 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; diff --git a/tests/MapTest.php b/tests/MapTest.php index 6c0a611..445e8eb 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -1,11 +1,6 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; diff --git a/tests/PdoWrapperTest.php b/tests/PdoWrapperTest.php index fdb30e4..53ff8e0 100644 --- a/tests/PdoWrapperTest.php +++ b/tests/PdoWrapperTest.php @@ -1,23 +1,16 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\database\PdoWrapper; use PDOStatement; +use PHPUnit\Framework\TestCase; -class PdoWrapperTest extends \PHPUnit\Framework\TestCase +class PdoWrapperTest extends TestCase { - /** - * @var Pdo_Wrapper - */ - private $pdo_wrapper; + private PdoWrapper $pdo_wrapper; protected function setUp(): void { diff --git a/tests/RedirectTest.php b/tests/RedirectTest.php index 9a53056..e44186e 100644 --- a/tests/RedirectTest.php +++ b/tests/RedirectTest.php @@ -1,17 +1,13 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\Engine; +use PHPUnit\Framework\TestCase; -class RedirectTest extends \PHPUnit\Framework\TestCase +class RedirectTest extends TestCase { private Engine $app; diff --git a/tests/RegisterTest.php b/tests/RegisterTest.php index 359857b..0fceb70 100644 --- a/tests/RegisterTest.php +++ b/tests/RegisterTest.php @@ -1,11 +1,6 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; diff --git a/tests/RenderTest.php b/tests/RenderTest.php index b489f42..04c9950 100644 --- a/tests/RenderTest.php +++ b/tests/RenderTest.php @@ -1,17 +1,13 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\Engine; +use PHPUnit\Framework\TestCase; -class RenderTest extends \PHPUnit\Framework\TestCase +class RenderTest extends TestCase { private Engine $app; diff --git a/tests/RequestTest.php b/tests/RequestTest.php index 8a9f9b5..e3cdfb5 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -1,18 +1,14 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\net\Request; use flight\util\Collection; +use PHPUnit\Framework\TestCase; -class RequestTest extends \PHPUnit\Framework\TestCase +class RequestTest extends TestCase { private Request $request; diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index 68b1e99..1b9c1da 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -1,18 +1,14 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use Exception; use flight\net\Response; +use PHPUnit\Framework\TestCase; -class ResponseTest extends \PHPUnit\Framework\TestCase +class ResponseTest extends TestCase { protected function setUp(): void { @@ -178,7 +174,7 @@ class ResponseTest extends \PHPUnit\Framework\TestCase 'max-age=0', ] ]; - public function setRealHeader(string $header_string, bool $replace = true, int $response_code = 0): Response + public function setRealHeader(string $header_string, bool $replace = true, int $response_code = 0): self { $this->test_sent_headers[] = $header_string; return $this; @@ -217,7 +213,7 @@ class ResponseTest extends \PHPUnit\Framework\TestCase $response = new class extends Response { protected $test_sent_headers = []; - public function setRealHeader(string $header_string, bool $replace = true, int $response_code = 0): Response + public function setRealHeader(string $header_string, bool $replace = true, int $response_code = 0): self { $this->test_sent_headers[] = $header_string; return $this; diff --git a/tests/RouterTest.php b/tests/RouterTest.php index a9465ef..1f0d33a 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -1,19 +1,15 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; use flight\core\Dispatcher; use flight\net\Request; use flight\net\Router; +use PHPUnit\Framework\TestCase; -class RouterTest extends \PHPUnit\Framework\TestCase +class RouterTest extends TestCase { private Router $router; @@ -45,15 +41,14 @@ class RouterTest extends \PHPUnit\Framework\TestCase // Checks if a route was matched with a given output public function check($str = '') { - /* - $route = $this->router->route($this->request); + + /*$route = $this->router->route($this->request); $params = array_values($route->params); $this->assertTrue(is_callable($route->callback)); - call_user_func_array($route->callback, $params); - */ + call_user_func_array($route->callback, $params);*/ $this->routeRequest(); $this->expectOutputString($str); diff --git a/tests/VariableTest.php b/tests/VariableTest.php index cf11ef1..2a38198 100644 --- a/tests/VariableTest.php +++ b/tests/VariableTest.php @@ -1,24 +1,19 @@ - * @license MIT, http://flightphp.com/license - */ +declare(strict_types=1); namespace tests; -class VariableTest extends \PHPUnit\Framework\TestCase +use flight\Engine; +use PHPUnit\Framework\TestCase; + +class VariableTest extends TestCase { - /** - * @var \flight\Engine - */ - private $app; + private Engine $app; protected function setUp(): void { - $this->app = new \flight\Engine(); + $this->app = new Engine(); } // Set and get a variable diff --git a/tests/ViewTest.php b/tests/ViewTest.php index 236f9f4..c29b051 100644 --- a/tests/ViewTest.php +++ b/tests/ViewTest.php @@ -1,8 +1,11 @@ assertEquals('<script>', $result); } - public function testENoNeedToEscape() + public function testeNoNeedToEscape() { $this->expectOutputString('script'); $result = $this->view->e('script'); diff --git a/tests/classes/Factory.php b/tests/classes/Factory.php index 2565330..efee09f 100644 --- a/tests/classes/Factory.php +++ b/tests/classes/Factory.php @@ -1,5 +1,7 @@ name = $name; } diff --git a/tests/phpunit_autoload.php b/tests/phpunit_autoload.php index 1114632..5bf47da 100644 --- a/tests/phpunit_autoload.php +++ b/tests/phpunit_autoload.php @@ -1,6 +1,9 @@