1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +00:00

Improve early identification tests (#66)

* Separate route-level domain identification test from path/request to improve readability WIP

* Get rid of confusing datasets in route-level identifcation tests

* Clean up updated tests

* Simplify early id tests

* Reduce dataset duplication

* Improve test readability, fix false positive,  polish details

* Separate early ID test from defaulting test (WIP)

* Finish improving and correcting the early identification/default route mode tests

* Make flag/default mode usage more clear by improving the docblock in DealsWithRouteContexts

* Fix PHPUnit deprecation warnings

* code review

* code review

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
This commit is contained in:
lukinovec 2024-12-20 03:42:23 +01:00 committed by GitHub
parent 48b916e182
commit cb0d7e2902
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 248 additions and 147 deletions

View file

@ -327,20 +327,20 @@ foreach ([
] as $datasetName => $middleware) {
dataset($datasetName, [
'kernel identification' => [
'route_middleware' => ['universal'],
'global_middleware' => $middleware,
['universal'], // Route middleware
$middleware, // Global middleware
],
'route-level identification' => [
'route_middleware' => ['universal', ...$middleware],
'global_middleware' => [],
['universal', ...$middleware], // Route middleware
[], // Global middleware
],
'kernel identification + defaulting to universal routes' => [
'route_middleware' => [],
'global_middleware' => ['universal', ...$middleware],
[], // Route middleware
['universal', ...$middleware], // Global middleware
],
'route-level identification + defaulting to universal routes' => [
'route_middleware' => $middleware,
'global_middleware' => ['universal'],
$middleware, // Route middleware
['universal'], // Global middleware
],
]);
}