mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:34:04 +00:00
Refactor tests to use pest() helper
This commit is contained in:
parent
05f2a828a1
commit
f9c9d8615f
26 changed files with 128 additions and 127 deletions
|
|
@ -81,7 +81,7 @@ test('ing events can be used to cancel db creation', function () {
|
|||
$tenant = Tenant::create();
|
||||
dispatch_now(new CreateDatabase($tenant));
|
||||
|
||||
$this->assertFalse($tenant->database()->manager()->databaseExists(
|
||||
pest()->assertFalse($tenant->database()->manager()->databaseExists(
|
||||
$tenant->database()->getName()
|
||||
));
|
||||
});
|
||||
|
|
@ -149,7 +149,7 @@ test('individual job pipelines can terminate while leaving others running', func
|
|||
|
||||
Tenant::create();
|
||||
|
||||
$this->assertSame([
|
||||
pest()->assertSame([
|
||||
'P1J1',
|
||||
'P1J2',
|
||||
'P2J1', // termminated after this
|
||||
|
|
@ -163,7 +163,7 @@ test('database is not migrated if creation is disabled', function () {
|
|||
JobPipeline::make([
|
||||
CreateDatabase::class,
|
||||
function () {
|
||||
$this->fail("The job pipeline didn't exit.");
|
||||
pest()->fail("The job pipeline didn't exit.");
|
||||
},
|
||||
MigrateDatabase::class,
|
||||
])->send(function (TenantCreated $event) {
|
||||
|
|
@ -176,7 +176,7 @@ test('database is not migrated if creation is disabled', function () {
|
|||
'tenancy_db_name' => 'already_created',
|
||||
]);
|
||||
|
||||
expect($this->hasFailed())->toBeFalse();
|
||||
expect(pest()->hasFailed())->toBeFalse();
|
||||
});
|
||||
|
||||
class FooListener extends QueueableListener
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue