mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 06:54:05 +00:00
revert changes in DatabasePreparationTest
This commit is contained in:
parent
e4a77dcc7b
commit
920f77f2d4
1 changed files with 0 additions and 54 deletions
|
|
@ -75,60 +75,6 @@ class DatabasePreparationTest extends TestCase
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
|
||||||
public function database_can_not_be_seeded_after_tenant_creation_in_production_without_force()
|
|
||||||
{
|
|
||||||
$this->app->detectEnvironment(function() {
|
|
||||||
return 'production';
|
|
||||||
});
|
|
||||||
|
|
||||||
config(['tenancy.seeder_parameters' => [
|
|
||||||
'--class' => TestSeeder::class,
|
|
||||||
]]);
|
|
||||||
|
|
||||||
Event::listen(TenantCreated::class, JobPipeline::make([
|
|
||||||
CreateDatabase::class,
|
|
||||||
MigrateDatabase::class,
|
|
||||||
SeedDatabase::class,
|
|
||||||
])->send(function (TenantCreated $event) {
|
|
||||||
return $event->tenant;
|
|
||||||
})->toListener());
|
|
||||||
|
|
||||||
$tenant = Tenant::create();
|
|
||||||
|
|
||||||
$tenant->run(function () {
|
|
||||||
$this->assertEmpty(User::first());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @test */
|
|
||||||
public function database_can_not_be_seeded_after_tenant_creation_in_production_with_force()
|
|
||||||
{
|
|
||||||
$this->app->detectEnvironment(function() {
|
|
||||||
return 'production';
|
|
||||||
});
|
|
||||||
|
|
||||||
config(['tenancy.seeder_parameters' => [
|
|
||||||
'--class' => TestSeeder::class,
|
|
||||||
'--force' => true,
|
|
||||||
]]);
|
|
||||||
|
|
||||||
Event::listen(TenantCreated::class, JobPipeline::make([
|
|
||||||
CreateDatabase::class,
|
|
||||||
MigrateDatabase::class,
|
|
||||||
SeedDatabase::class,
|
|
||||||
])->send(function (TenantCreated $event) {
|
|
||||||
return $event->tenant;
|
|
||||||
})->toListener());
|
|
||||||
|
|
||||||
$tenant = Tenant::create();
|
|
||||||
|
|
||||||
$tenant->run(function () {
|
|
||||||
$this->assertSame('Seeded User', User::first()->name);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function custom_job_can_be_added_to_the_pipeline()
|
public function custom_job_can_be_added_to_the_pipeline()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue