Make quick iteration testing easier
This commit is contained in:
parent
da39d9177e
commit
f0e3f0e474
1 changed files with 14 additions and 4 deletions
|
@ -17,12 +17,22 @@ $kernel->bootstrap();
|
||||||
|
|
||||||
$output = new ConsoleOutput;
|
$output = new ConsoleOutput;
|
||||||
|
|
||||||
|
if (config('database.default') !== 'testing') {
|
||||||
|
$output->writeln(PHP_EOL . '<error>Cannot run test process against non-testing database.</error>');
|
||||||
|
$output->writeln(PHP_EOL . '<error>Environment is currently pointed at: "' . config('database.default') . '".</error>');
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform database migrations and reseeding before continuing with
|
* Perform database migrations and reseeding before continuing with
|
||||||
* running the tests.
|
* running the tests.
|
||||||
*/
|
*/
|
||||||
$output->writeln(PHP_EOL . '<comment>Refreshing database for Integration tests...</comment>');
|
if (!env('SKIP_MIGRATIONS')) {
|
||||||
$kernel->call('migrate:fresh', ['--database' => 'testing']);
|
$output->writeln(PHP_EOL . '<info>Refreshing database for Integration tests...</info>');
|
||||||
|
$kernel->call('migrate:fresh', ['--database' => 'testing']);
|
||||||
|
|
||||||
$output->writeln('<comment>Seeding database for Integration tests...</comment>' . PHP_EOL);
|
$output->writeln('<info>Seeding database for Integration tests...</info>' . PHP_EOL);
|
||||||
$kernel->call('db:seed', ['--database' => 'testing']);
|
$kernel->call('db:seed', ['--database' => 'testing']);
|
||||||
|
} else {
|
||||||
|
$output->writeln(PHP_EOL . '<comment>Skipping database migrations...</comment>' . PHP_EOL);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue