diff --git a/tests/DatabasePreparationTest.php b/tests/DatabasePreparationTest.php index fa27a1c9..f66ebf1e 100644 --- a/tests/DatabasePreparationTest.php +++ b/tests/DatabasePreparationTest.php @@ -2,8 +2,6 @@ declare(strict_types=1); -use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Schema; use Stancl\JobPipeline\JobPipeline; diff --git a/tests/ResourceSyncingTest.php b/tests/ResourceSyncingTest.php index 80254357..c78f6838 100644 --- a/tests/ResourceSyncingTest.php +++ b/tests/ResourceSyncingTest.php @@ -49,7 +49,7 @@ beforeEach(function () { UpdateSyncedResource::$shouldQueue = false; // global state cleanup Event::listen(SyncedResourceSaved::class, UpdateSyncedResource::class); - $this->artisan('migrate', [ + test()->artisan('migrate', [ '--path' => [ __DIR__ . '/Etc/synced_resource_migrations', __DIR__ . '/Etc/synced_resource_migrations/users', @@ -225,7 +225,7 @@ test('attaching a tenant to the central resource triggers a pull from the tenant }); }); -test('attaching users to tenants d o e s n o t d o a n y t h i n g', function () { +test('attaching users to tenants does not do anything', function () { $centralUser = CentralUser::create([ 'global_id' => 'acme', 'name' => 'John Doe', @@ -294,7 +294,7 @@ test('resources are synced only to workspaces that have the resource', function }); }); -test('when a resource exists in other tenant dbs but is c r e a t e d in a tenant db the synced columns are updated in the other dbs', function () { +test('when a resource exists in other tenant dbs but is created in a tenant db the synced columns are updated in the other dbs', function () { // create shared resource $centralUser = CentralUser::create([ 'global_id' => 'acme', @@ -570,6 +570,7 @@ function migrateTenantsResource() '--realpath' => true, ])->assertExitCode(0); } + class ResourceTenant extends Tenant { public function users() diff --git a/tests/SingleDatabaseTenancyTest.php b/tests/SingleDatabaseTenancyTest.php index 84f1b707..2010df24 100644 --- a/tests/SingleDatabaseTenancyTest.php +++ b/tests/SingleDatabaseTenancyTest.php @@ -158,7 +158,7 @@ test('secondary models are scoped to the current tenant when accessed via primar expect(Post::first()->comments->count())->toBe(1); }); -test('secondary models are n o t scoped to the current tenant when accessed directly', function () { +test('secondary models are not scoped to the current tenant when accessed directly', function () { // $this->secondary_models_are_scoped_to_the_current_tenant_when_accessed_via_primary_model(); // acme context tenancy()->initialize($acme = Tenant::create([ @@ -189,7 +189,7 @@ test('secondary models are n o t scoped to the current tenant when accessed dire expect(Comment::count())->toBe(2); }); -test('secondary models a r e scoped to the current tenant when accessed directly a n d p a r e n t r e l a t i o n s h i p t r a i t i s u s e d', function () { +test('secondary models a r e scoped to the current tenant when accessed directly and parent relationship traitis used', function () { $acme = Tenant::create([ 'id' => 'acme', ]); @@ -221,7 +221,7 @@ test('secondary models a r e scoped to the current tenant when accessed directly expect(ScopedComment::count())->toBe(2); }); -test('secondary models are n o t scoped in the central context', function () { +test('secondary models are not scoped in the central context', function () { // $this->secondary_models_are_scoped_to_the_current_tenant_when_accessed_via_primary_model(); // acme context tenancy()->initialize($acme = Tenant::create([ diff --git a/tests/TenantAssetTest.php b/tests/TenantAssetTest.php index 3a804a1f..bb140ea5 100644 --- a/tests/TenantAssetTest.php +++ b/tests/TenantAssetTest.php @@ -96,7 +96,6 @@ test('asset helper tenancy can be disabled', function () { expect(asset('foo'))->toBe($original); }); -// Helpers function getEnvironmentSetUp($app) { // parent::getEnvironmentSetUp($app); diff --git a/tests/TenantUserImpersonationTest.php b/tests/TenantUserImpersonationTest.php index 81d99d1c..6f7d7de6 100644 --- a/tests/TenantUserImpersonationTest.php +++ b/tests/TenantUserImpersonationTest.php @@ -225,7 +225,6 @@ test('impersonation works with multiple models and guards', function () { }); }); -// Helpers function migrateTenants() { test()->artisan('tenants:migrate')->assertExitCode(0);