From 5ed8e75f22aed25f0aa81e99c72aade6add5f791 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 20 Nov 2026 08:50:30 +0300 Subject: [PATCH] feat: support Engine 9 compatibility --- README.en.md | 110 +++++++++++++++++++++++ README.md | 31 +++++-- Router.php | 2 +- composer.json | 2 +- src/BadRouteException.php | 2 +- src/Bootstrap.php | 2 +- src/Config/route.php | 2 +- src/DataGenerator.php | 2 +- src/DataGenerator/CharCountBased.php | 2 +- src/DataGenerator/GroupCountBased.php | 2 +- src/DataGenerator/GroupPosBased.php | 2 +- src/DataGenerator/MarkBased.php | 2 +- src/DataGenerator/RegexBasedAbstract.php | 2 +- src/Dispatcher.php | 2 +- src/Dispatcher/CharCountBased.php | 2 +- src/Dispatcher/GroupCountBased.php | 2 +- src/Dispatcher/GroupPosBased.php | 2 +- src/Dispatcher/MarkBased.php | 2 +- src/Dispatcher/RegexBasedAbstract.php | 2 +- src/Install.php | 2 +- src/RouteObject.php | 2 +- src/RouteParser.php | 2 +- src/RouteParser/Std.php | 2 +- src/RouteStatic.php | 2 +- src/RouteVariable.php | 2 +- src/functions.php | 2 +- tests/Unit/RouteTest.php | 22 +++++ tests/bootstrap.php | 22 +++++ 28 files changed, 203 insertions(+), 30 deletions(-) create mode 100644 README.en.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..c643702 --- /dev/null +++ b/README.en.md @@ -0,0 +1,110 @@ +

+ Localzet Group +

+ +# Triangle Router + +[![Packagist version](https://img.shields.io/packagist/v/triangle/router)](https://packagist.org/packages/triangle/router) +[![PHP requirement](https://img.shields.io/packagist/dependency-v/triangle/router/php)](https://packagist.org/packages/triangle/router) +[![License](https://img.shields.io/github/license/Triangle-org/Router)](https://github.com/Triangle-org/Router) + +Triangle Router matches HTTP methods and URI paths against route patterns and returns the matched handler with named parameters. It is a routing component; the application remains responsible for invoking handlers and producing HTTP responses. + +[Русская документация](README.md) + +## Requirements and compatibility + +- PHP 8.1 or later (`^8.1` in Composer). +- `triangle/engine` `^8.1 || ^9.0` in the current source branch. + +Engine 9 does not yet have a stable release tag. The source constraint is not proof that a stable published Composer release is available or verified against Engine 9. Check the resolved packages with `composer show triangle/router triangle/engine`. + +## Installation + +```sh +composer require triangle/router +``` + +Composer loads the package functions from `src/functions.php`, so the Composer autoloader must be included before calling `simpleRouteDispatcher()` or `cachedRouteDispatcher()`. + +## Quick start + +```php +addRoute('GET', '/users/{id:\\d+}', static fn (array $params): array => $params); +}); + +$result = $dispatcher->dispatch('GET', '/users/42'); + +switch ($result[0]) { + case Triangle\Router\Dispatcher::FOUND: + [$status, $handler, $parameters] = $result; + // Invoke the handler and translate its result to an HTTP response. + break; + + case Triangle\Router\Dispatcher::METHOD_NOT_ALLOWED: + $allowedMethods = $result[1]; + // Return 405 and include the methods in the Allow response header. + break; + + case Triangle\Router\Dispatcher::NOT_FOUND: + // Return 404. + break; +} +``` + +`FOUND` results contain the handler and an associative array of route parameters. `METHOD_NOT_ALLOWED` results contain the allowed HTTP methods in the second tuple item. The router does not create the HTTP response or set its headers. + +## Defining routes + +`simpleRouteDispatcher()` accepts a callback that receives a `Triangle\Router` instance. Register one or several methods: + +```php +$router->addRoute('GET', '/health', static fn (): string => 'ok'); +$router->addRoute(['GET', 'POST'], '/users', static fn (): array => []); +$router->addRoute('GET', '/users/{id:\\d+}[/{tab}]', static fn (array $params): array => $params); +``` + +A `{name}` placeholder matches a non-empty path segment by default. Add a regular expression after the colon to constrain it, such as `{id:\\d+}`. Bracketed sections are optional route parts. Custom expressions should not capture groups that alter parameter matching. + +Route groups can prefix multiple routes. The package also provides the `get`, `post`, `put`, `patch`, `delete`, `head`, `options`, and `any` helper methods through `Triangle\Router`; see the class API for their exact signatures. + +## Route cache + +For applications that want to persist the generated dispatch data, use `cachedRouteDispatcher()` and supply a cache file: + +```php +$dispatcher = cachedRouteDispatcher($defineRoutes, [ + 'cacheFile' => __DIR__ . '/var/routes.php', +]); +``` + +The helper loads an existing PHP cache file unless `cacheDisabled` is enabled; otherwise it builds the route data and writes it to the configured path. Ensure the deployment process can write that path when generating the cache, and regenerate it whenever route definitions change. Do not use a writable cache directory as a trust boundary: the generated file is executable PHP. + +## HTTP method behavior + +The dispatcher reports `FOUND`, `NOT_FOUND`, or `METHOD_NOT_ALLOWED`. Applications should turn these into appropriate responses and include an `Allow` header for a 405 response using the methods returned by the dispatcher. + +A GET route can also match HEAD when no explicit HEAD route exists. PHP SAPI normally suppresses the response body for HEAD. Applications running outside PHP SAPI must suppress it themselves; the router does not control response transmission. + +## Triangle Engine integration + +The package includes `Triangle\Router\Bootstrap`, which implements the Engine bootstrap interface. When started with a `localzet\Server` instance it collects route configuration from the configured application paths and plugin configuration directories. For framework applications, follow the Engine bootstrap and route-configuration conventions of the Engine version actually installed. The standalone dispatcher examples above do not require the Engine request lifecycle. + +## Tests + +Run the repository's declared test suite from its root: + +```sh +composer test --no-interaction +``` + +This runs PHPUnit using `tests/phpunit.xml`. The current unit suite contains four tests in `tests/Unit/RouteTest.php`; it is not an exhaustive integration or production compatibility suite. + +## License + +AGPL-3.0-or-later. See [LICENSE](LICENSE). diff --git a/README.md b/README.md index 2b8f55d..10a33b5 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ composer require triangle/router ``` -Требуется PHP 8.0 или выше. +Требуется PHP 8.1 или выше (ограничение `^8.1` в Composer). Usage ----- @@ -47,7 +47,7 @@ Usage require '/path/to/vendor/autoload.php'; -$dispatcher = simpleRouteDispatcher(function(Triangle\Router\RouteCollector $r) { +$dispatcher = simpleRouteDispatcher(function(Triangle\Router $r) { $r->addRoute('GET', '/users', 'get_all_users_handler'); // {id} должен быть числом (\d+) $r->addRoute('GET', '/user/{id:\d+}', 'get_user_handler'); @@ -85,7 +85,7 @@ switch ($routeInfo[0]) { ### Определение маршрутов Маршруты определяются путем вызова функции `simpleRouteDispatcher()`, которая принимает -вызываемый объект, принимающий экземпляр `Triangle\Router\RouteCollector`. Маршруты добавляются путем вызова +вызываемый объект, принимающий экземпляр `Triangle\Router`. Маршруты добавляются путем вызова `addRoute()` на экземпляре коллектора: ```php @@ -172,7 +172,7 @@ $r->any('/any-route', 'any_handler'); Например, определение ваших маршрутов как: ```php -$r->addGroup('/admin', function (RouteCollector $r) { +$r->addGroup('/admin', function (\Triangle\Router $r) { $r->addRoute('GET', '/do-something', 'handler'); $r->addRoute('GET', '/do-another-thing', 'handler'); $r->addRoute('GET', '/do-something-else', 'handler'); @@ -198,7 +198,7 @@ $r->addRoute('GET', '/admin/do-something-else', 'handler'); ```php addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); $r->addRoute('GET', '/user/{name}', 'handler2'); @@ -296,7 +296,7 @@ interface Dispatcher { ```php 'Triangle\\Router\\RouteParser\\Std', @@ -325,6 +325,25 @@ $dispatcher = simpleRouteDispatcher(function(Triangle\Router\RouteCollector $r) Наконец, обратите внимание, что приложения МОГУТ всегда указывать свой собственный маршрут метода HEAD для данного ресурса, чтобы полностью обойти это поведение. + +## Версия и совместимость + +Текущий исходный код требует PHP 8.1+ и объявляет совместимость с `triangle/engine` `^8.1 || ^9.0`. Ветка Engine 9 пока не имеет стабильного релизного тега: наличие ограничения в исходной ветке не означает, что опубликованный пакет Composer уже выпущен и проверен с Engine 9. Проверяйте фактически установленную версию через `composer show triangle/router triangle/engine`. + +Пакет подключает глобальные функции `simpleRouteDispatcher()`, `cachedRouteDispatcher()` и `route()` через Composer autoload. Маршрутизатор возвращает кортеж статуса, обработчика и параметров; формирование HTTP-ответа и заголовка `Allow` для 405 остаётся задачей приложения. При использовании GET-маршрута для HEAD приложение вне PHP SAPI должно само подавить тело ответа. + +## Проверки + +Запуск тестов из корня репозитория: + +```sh +composer test --no-interaction +``` + +Команда запускает PHPUnit с конфигурацией `tests/phpunit.xml`. Набор `tests/Unit/RouteTest.php` содержит четыре теста; фактическое число assertions зависит от результата PHPUnit. Это небольшой unit-набор, а не подтверждение полного поведения в production или совместимости со всеми версиями Engine. + +Документация: [English](README.en.md). + ### Авторы Эта библиотека основана на маршрутизаторах, реализованных [Levi Morrison][levi] и [Nikita Popov][nikic]. diff --git a/Router.php b/Router.php index fbc9ca4..491b405 100644 --- a/Router.php +++ b/Router.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/composer.json b/composer.json index 3651e64..c6da106 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require": { "php": "^8.1", - "triangle/engine": "^8.1" + "triangle/engine": "^8.1 || ^9.0" }, "require-dev": { "phpunit/phpunit": "^10.5" diff --git a/src/BadRouteException.php b/src/BadRouteException.php index f042241..7294c99 100644 --- a/src/BadRouteException.php +++ b/src/BadRouteException.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Bootstrap.php b/src/Bootstrap.php index 5981229..228e850 100644 --- a/src/Bootstrap.php +++ b/src/Bootstrap.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Config/route.php b/src/Config/route.php index 937c22d..830ca41 100644 --- a/src/Config/route.php +++ b/src/Config/route.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator.php b/src/DataGenerator.php index 3a5c714..b8f6050 100644 --- a/src/DataGenerator.php +++ b/src/DataGenerator.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator/CharCountBased.php b/src/DataGenerator/CharCountBased.php index 01ce281..e5795b5 100644 --- a/src/DataGenerator/CharCountBased.php +++ b/src/DataGenerator/CharCountBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator/GroupCountBased.php b/src/DataGenerator/GroupCountBased.php index a82655b..30d80d3 100644 --- a/src/DataGenerator/GroupCountBased.php +++ b/src/DataGenerator/GroupCountBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator/GroupPosBased.php b/src/DataGenerator/GroupPosBased.php index 006943a..2789e65 100644 --- a/src/DataGenerator/GroupPosBased.php +++ b/src/DataGenerator/GroupPosBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator/MarkBased.php b/src/DataGenerator/MarkBased.php index cacb0ef..c2bda32 100644 --- a/src/DataGenerator/MarkBased.php +++ b/src/DataGenerator/MarkBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/DataGenerator/RegexBasedAbstract.php b/src/DataGenerator/RegexBasedAbstract.php index e296aea..da71127 100644 --- a/src/DataGenerator/RegexBasedAbstract.php +++ b/src/DataGenerator/RegexBasedAbstract.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher.php b/src/Dispatcher.php index 786f627..646a005 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher/CharCountBased.php b/src/Dispatcher/CharCountBased.php index 7aede89..112984c 100644 --- a/src/Dispatcher/CharCountBased.php +++ b/src/Dispatcher/CharCountBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher/GroupCountBased.php b/src/Dispatcher/GroupCountBased.php index 186d12e..dcf3ce6 100644 --- a/src/Dispatcher/GroupCountBased.php +++ b/src/Dispatcher/GroupCountBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher/GroupPosBased.php b/src/Dispatcher/GroupPosBased.php index 6a856d5..6afef61 100644 --- a/src/Dispatcher/GroupPosBased.php +++ b/src/Dispatcher/GroupPosBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher/MarkBased.php b/src/Dispatcher/MarkBased.php index 1c7176b..6613ae9 100644 --- a/src/Dispatcher/MarkBased.php +++ b/src/Dispatcher/MarkBased.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Dispatcher/RegexBasedAbstract.php b/src/Dispatcher/RegexBasedAbstract.php index 21ffcde..f6739c5 100644 --- a/src/Dispatcher/RegexBasedAbstract.php +++ b/src/Dispatcher/RegexBasedAbstract.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/Install.php b/src/Install.php index 058f4f5..08e1329 100644 --- a/src/Install.php +++ b/src/Install.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/RouteObject.php b/src/RouteObject.php index c3f743b..10d68d7 100644 --- a/src/RouteObject.php +++ b/src/RouteObject.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/RouteParser.php b/src/RouteParser.php index cf51f5c..de924b8 100644 --- a/src/RouteParser.php +++ b/src/RouteParser.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/RouteParser/Std.php b/src/RouteParser/Std.php index 46dbcac..269cd44 100644 --- a/src/RouteParser/Std.php +++ b/src/RouteParser/Std.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/RouteStatic.php b/src/RouteStatic.php index 0ad894e..5292cc9 100644 --- a/src/RouteStatic.php +++ b/src/RouteStatic.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/RouteVariable.php b/src/RouteVariable.php index 758f360..677cd5c 100644 --- a/src/RouteVariable.php +++ b/src/RouteVariable.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/src/functions.php b/src/functions.php index de85941..ad1990b 100644 --- a/src/functions.php +++ b/src/functions.php @@ -5,7 +5,7 @@ * @link https://github.com/Triangle-org/Router * * @author Ivan Zorin - * @copyright Copyright (c) 2023-2025 Triangle Framework Team + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 * * This program is free software: you can redistribute it and/or modify diff --git a/tests/Unit/RouteTest.php b/tests/Unit/RouteTest.php index 3dcf6d9..1ece0d8 100644 --- a/tests/Unit/RouteTest.php +++ b/tests/Unit/RouteTest.php @@ -1,5 +1,27 @@ + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. + * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + namespace Tests\Unit; use PHPUnit\Framework\TestCase; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ecb929d..8b60abd 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,26 @@ + * @copyright Copyright © 2016-2026 Localzet Group. All rights reserved. + * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ /** * PHPUnit bootstrap file for Router tests */