File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1717
1818$ output = new ConsoleOutput ;
1919
20+ if (config ('database.default ' ) !== 'testing ' ) {
21+ $ output ->writeln (PHP_EOL . '<error>Cannot run test process against non-testing database.</error> ' );
22+ $ output ->writeln (PHP_EOL . '<error>Environment is currently pointed at: " ' . config ('database.default ' ) . '".</error> ' );
23+ exit (1 );
24+ }
25+
2026/*
2127 * Perform database migrations and reseeding before continuing with
2228 * running the tests.
2329 */
24- $ output ->writeln (PHP_EOL . '<comment>Refreshing database for Integration tests...</comment> ' );
25- $ kernel ->call ('migrate:fresh ' , ['--database ' => 'testing ' ]);
26-
27- $ output ->writeln ('<comment>Seeding database for Integration tests...</comment> ' . PHP_EOL );
28- $ kernel ->call ('db:seed ' , ['--database ' => 'testing ' ]);
30+ if (!env ('SKIP_MIGRATIONS ' )) {
31+ $ output ->writeln (PHP_EOL . '<info>Refreshing database for Integration tests...</info> ' );
32+ $ kernel ->call ('migrate:fresh ' , ['--database ' => 'testing ' ]);
33+
34+ $ output ->writeln ('<info>Seeding database for Integration tests...</info> ' . PHP_EOL );
35+ $ kernel ->call ('db:seed ' , ['--database ' => 'testing ' ]);
36+ } else {
37+ $ output ->writeln (PHP_EOL . '<comment>Skipping database migrations...</comment> ' . PHP_EOL );
38+ }
You can’t perform that action at this time.
0 commit comments