mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
Filesystem logic refactor, improved defaults for cache tenancy (#42)
* refactor FilesystemTenancyBootstrapper * clean up tests and improve coverage * minor maintenance mode changes * Improve tenants:migrate --skip-failing logic * make tenants:migrate output consistently formatted * minor RootUrlBootstrapper + misc changes * cache bootstrapper-related improvements * Fix code style (php-cs-fixer) * misc refactor * Fix code style (php-cs-fixer) * add %original_storage_path% to fs bootstrapper, improve default config for cache * rename method * inject concrete implementations where needed instead of abstracts * Fix code style (php-cs-fixer) * refactor DealsWithTenantSymlinks * remove obsolete phpstan ignore --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
This commit is contained in:
parent
4b6fa22aa7
commit
a41ad69023
23 changed files with 234 additions and 160 deletions
|
|
@ -24,6 +24,7 @@ use Stancl\Tenancy\Events\TenancyInitialized;
|
|||
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||
use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
|
||||
use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper;
|
||||
use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException;
|
||||
|
||||
beforeEach(function () {
|
||||
|
|
@ -298,6 +299,8 @@ test('run command with array of tenants works', function () {
|
|||
});
|
||||
|
||||
test('link command works', function() {
|
||||
config(['tenancy.bootstrappers' => [FilesystemTenancyBootstrapper::class]]);
|
||||
|
||||
$tenantId1 = Tenant::create()->getTenantKey();
|
||||
$tenantId2 = Tenant::create()->getTenantKey();
|
||||
pest()->artisan('tenants:link')
|
||||
|
|
@ -318,6 +321,8 @@ test('link command works', function() {
|
|||
});
|
||||
|
||||
test('link command works with a specified tenant', function() {
|
||||
config(['tenancy.bootstrappers' => [FilesystemTenancyBootstrapper::class]]);
|
||||
|
||||
$tenantKey = Tenant::create()->getTenantKey();
|
||||
|
||||
pest()->artisan('tenants:link', [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue