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

Update specific attributes of pending tenants while they're being pulled (#59)

* Add option to update attributes of pending tenants while pulling them

* Fix failing toEqualCanonicalizing tests

* Fix code style (php-cs-fixer)

* fix code errors

* lock phpcsfixer to 3.62.0 due to a bug in 3.63.1

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
This commit is contained in:
lukinovec 2024-08-28 00:41:16 +02:00 committed by GitHub
parent 87e02f207f
commit 6b74589d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 12 deletions

View file

@ -98,14 +98,14 @@ test('CloneRoutesAsTenant registers prefixed duplicates of universal routes corr
// Universal flag is excluded from the route middleware
expect(tenancy()->getRouteMiddleware($newRoutes->first()))
->toEqualCanonicalizing(
array_filter(array_merge(tenancy()->getRouteMiddleware($universalRoute), ['tenant']),
fn($middleware) => $middleware !== 'universal')
array_values(array_filter(array_merge(tenancy()->getRouteMiddleware($universalRoute), ['tenant']),
fn($middleware) => $middleware !== 'universal'))
);
// Universal flag is provided statically in the route's controller, so we cannot exclude it
expect(tenancy()->getRouteMiddleware($newRoutes->last()))
->toEqualCanonicalizing(
array_merge(tenancy()->getRouteMiddleware($universalRoute2), ['tenant'])
array_values(array_merge(tenancy()->getRouteMiddleware($universalRoute2), ['tenant']))
);
$tenant = Tenant::create();
@ -236,7 +236,7 @@ test('routes with the clone flag get cloned without making the routes universal'
$clonedRoute = RouteFacade::getRoutes()->getByName('tenant.' . $routeName);
expect($clonedRoute->middleware())->toEqualCanonicalizing(['tenant', $identificationMiddleware]);
expect(array_values($clonedRoute->middleware()))->toEqualCanonicalizing(['tenant', $identificationMiddleware]);
// The original route is not accessible
pest()->get(route($routeName))->assertServerError();