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

add assertion, update todos

This commit is contained in:
Samuel Štancl 2024-04-10 03:35:57 +02:00
parent 20c1b9a940
commit 630f404227
2 changed files with 3 additions and 1 deletions

View file

@ -40,7 +40,6 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
$this->forgetDisks();
$this->scopeCache($suffix);
$this->scopeSessions($suffix);
// todo@docs update fs docs
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
$this->diskRoot($disk, $tenant);

View file

@ -24,6 +24,8 @@ use Stancl\Tenancy\Middleware\InitializeTenancyByPath;
use Stancl\Tenancy\Middleware\PreventAccessFromUnwantedDomains;
use Stancl\Tenancy\Tests\Etc\Tenant;
// todo@tests write similar low-level tests for the cache bootstrapper? including the database driver in a single-db setup
beforeEach(function () {
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
@ -192,6 +194,7 @@ test('apc sessions are separated using the cache bootstrapper', function (bool $
]);
$allApcuKeys = fn () => array_column(apcu_cache_info()['cache_list'], 'info');
expect($allApcuKeys())->toHaveCount(0);
$tenant = Tenant::create();
Route::middleware(StartSession::class, InitializeTenancyByPath::class)->get('/{tenant}/foo', fn () => 'bar');