diff --git a/src/Database/Concerns/HasPending.php b/src/Database/Concerns/HasPending.php index 9eae7614..2d316e71 100644 --- a/src/Database/Concerns/HasPending.php +++ b/src/Database/Concerns/HasPending.php @@ -69,13 +69,13 @@ trait HasPending } /** Pull a pending tenant. */ - public static function pullPendingTenant(): Tenant + public static function pullPending(): Tenant { - return static::pullPendingTenantFromPool(true); + return static::pullPendingFromPool(true); } /** Try to pull a tenant from the pool of pending tenants. */ - public static function pullPendingTenantFromPool(bool $firstOrCreate = false): ?Tenant + public static function pullPendingFromPool(bool $firstOrCreate = false): ?Tenant { if (! static::onlyPending()->exists()) { if (! $firstOrCreate) { diff --git a/tests/PendingTenantsTest.php b/tests/PendingTenantsTest.php index 7811f253..e9476c3f 100644 --- a/tests/PendingTenantsTest.php +++ b/tests/PendingTenantsTest.php @@ -95,17 +95,17 @@ test('tenancy can check for pending tenants', function () { }); test('tenancy can pull a pending tenant', function () { - expect(Tenant::pullPendingTenant())->toBeNull(); + expect(Tenant::pullPending())->toBeNull(); Tenant::createPending(); - expect(Tenant::pullPendingTenant(true))->toBeInstanceOf(Tenant::class); + expect(Tenant::pullPending())->toBeInstanceOf(Tenant::class); }); test('tenancy can create if none are pending', function () { expect(Tenant::all()->count())->toBe(0); - Tenant::pullPendingTenant(true); + Tenant::pullPending(); expect(Tenant::all()->count())->toBe(1); }); @@ -136,7 +136,7 @@ test('pending events are dispatched', function () { Event::assertDispatched(CreatingPendingTenant::class); Event::assertDispatched(PendingTenantCreated::class); - Tenant::pullPendingTenant(); + Tenant::pullPending(); Event::assertDispatched(PullingPendingTenant::class); Event::assertDispatched(PendingTenantPulled::class);