mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:34:04 +00:00
Fix skip-failing test
This commit is contained in:
parent
dda3e36ad6
commit
726f769318
1 changed files with 4 additions and 7 deletions
|
|
@ -97,19 +97,16 @@ test('migrate command loads schema state', function () {
|
||||||
test('migrate command only throws exceptions if skip-failing is not passed', function() {
|
test('migrate command only throws exceptions if skip-failing is not passed', function() {
|
||||||
Tenant::create();
|
Tenant::create();
|
||||||
|
|
||||||
Event::forget(TenantCreated::class);
|
$tenantWithoutDatabase = Tenant::create(['id' => 'withoutdb']);
|
||||||
|
$databaseToDrop = $tenantWithoutDatabase->run(fn() => DB::connection()->getDatabaseName());
|
||||||
|
|
||||||
Tenant::create(['id' => 'withoutdb']);
|
DB::statement('DROP DATABASE ' . $databaseToDrop);
|
||||||
|
|
||||||
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
|
||||||
return $event->tenant;
|
|
||||||
})->toListener());
|
|
||||||
|
|
||||||
Tenant::create();
|
Tenant::create();
|
||||||
|
|
||||||
expect(fn() => pest()->artisan('tenants:migrate --schema-path="tests/Etc/tenant-schema.dump"'))->toThrow(Exception::class);
|
expect(fn() => pest()->artisan('tenants:migrate --schema-path="tests/Etc/tenant-schema.dump"'))->toThrow(Exception::class);
|
||||||
expect(fn() => pest()->artisan('tenants:migrate --schema-path="tests/Etc/tenant-schema.dump" --skip-failing'))->not()->toThrow(Exception::class);
|
expect(fn() => pest()->artisan('tenants:migrate --schema-path="tests/Etc/tenant-schema.dump" --skip-failing'))->not()->toThrow(Exception::class);
|
||||||
});
|
})->group('skipfailing');
|
||||||
|
|
||||||
test('dump command works', function () {
|
test('dump command works', function () {
|
||||||
$tenant = Tenant::create();
|
$tenant = Tenant::create();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue