From 0769e187acae6ca9b0144b925ee8f52aa611a4e5 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 21 Oct 2022 11:05:29 +0200 Subject: [PATCH] Add a test that checks if pulling a pending tenant removes it from the pool --- tests/PendingTenantsTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/PendingTenantsTest.php b/tests/PendingTenantsTest.php index e9476c3f..3529db61 100644 --- a/tests/PendingTenantsTest.php +++ b/tests/PendingTenantsTest.php @@ -95,11 +95,17 @@ test('tenancy can check for pending tenants', function () { }); test('tenancy can pull a pending tenant', function () { - expect(Tenant::pullPending())->toBeNull(); + expect(Tenant::pullPending())->toBeInstanceOf(Tenant::class); +}); +test('pulling a tenant from the pending tenant pool removes it from the pool', function () { Tenant::createPending(); - expect(Tenant::pullPending())->toBeInstanceOf(Tenant::class); + expect(Tenant::onlyPending()->count())->toEqual(1); + + Tenant::pullPendingFromPool(); + + expect(Tenant::onlyPending()->count())->toEqual(0); }); test('tenancy can create if none are pending', function () {