1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 19:14:03 +00:00

Fix tests

This commit is contained in:
Samuel Štancl 2020-03-17 17:51:38 +01:00
parent 0540fe4581
commit 157f87ae0c
6 changed files with 161 additions and 6 deletions

View file

@ -127,7 +127,11 @@ class CommandsTest extends TestCase
mkdir($dir, 0777, true);
}
file_put_contents(app_path('Http/Kernel.php'), file_get_contents(__DIR__ . '/Etc/defaultHttpKernel.stub'));
if (app()->version()[0] === '6') {
file_put_contents(app_path('Http/Kernel.php'), file_get_contents(__DIR__ . '/Etc/defaultHttpKernelv6.stub'));
} else {
file_put_contents(app_path('Http/Kernel.php'), file_get_contents(__DIR__ . '/Etc/defaultHttpKernelv7.stub'));
}
$this->artisan('tenancy:install')
->expectsQuestion('Do you wish to publish the migrations that create these tables?', 'yes');
@ -136,7 +140,12 @@ class CommandsTest extends TestCase
$this->assertFileExists(database_path('migrations/2019_09_15_000010_create_tenants_table.php'));
$this->assertFileExists(database_path('migrations/2019_09_15_000020_create_domains_table.php'));
$this->assertDirectoryExists(database_path('migrations/tenant'));
$this->assertSame(file_get_contents(__DIR__ . '/Etc/modifiedHttpKernel.stub'), file_get_contents(app_path('Http/Kernel.php')));
if (app()->version()[0] === '6') {
$this->assertSame(file_get_contents(__DIR__ . '/Etc/modifiedHttpKernelv6.stub'), file_get_contents(app_path('Http/Kernel.php')));
} else {
$this->assertSame(file_get_contents(__DIR__ . '/Etc/modifiedHttpKernelv7.stub'), file_get_contents(app_path('Http/Kernel.php')));
}
}
/** @test */