mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:44:02 +00:00
Improve code of pending tenants (#1025)
* Remove `--all` option from ClearPendingTenants * Improve query formatting * Remove redundant test * Convert time constrait options to int * Improve CreatePendingTenants success message
This commit is contained in:
parent
73c5655bc8
commit
7d3298c6bb
4 changed files with 19 additions and 46 deletions
|
|
@ -67,23 +67,6 @@ test('CreatePendingTenants command cannot run with both time constraints', funct
|
|||
->assertFailed();
|
||||
});
|
||||
|
||||
test('CreatePendingTenants commands all option overrides any config constraints', function () {
|
||||
Tenant::createPending();
|
||||
Tenant::createPending();
|
||||
|
||||
tenancy()->model()->query()->onlyPending()->first()->update([
|
||||
'pending_since' => now()->subDays(10)
|
||||
]);
|
||||
|
||||
config(['tenancy.pending.older_than_days' => 4]);
|
||||
|
||||
Artisan::call(ClearPendingTenants::class, [
|
||||
'--all' => true
|
||||
]);
|
||||
|
||||
expect(Tenant::onlyPending()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('tenancy can check if there are any pending tenants', function () {
|
||||
expect(Tenant::onlyPending()->exists())->toBeFalse();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue