diff --git a/src/Illuminate/Testing/Concerns/TestDatabases.php b/src/Illuminate/Testing/Concerns/TestDatabases.php index 3b429a2937ec..d347c336c7de 100644 --- a/src/Illuminate/Testing/Concerns/TestDatabases.php +++ b/src/Illuminate/Testing/Concerns/TestDatabases.php @@ -141,6 +141,10 @@ protected function usingDatabase($database, $callable) */ protected function whenNotUsingInMemoryDatabase($callback) { + if (ParallelTesting::option('without_databases')) { + return; + } + $database = DB::getConfig('database'); if ($database !== ':memory:') { diff --git a/tests/Integration/Testing/TestWithoutDatabaseParallelTest.php b/tests/Integration/Testing/TestWithoutDatabaseParallelTest.php new file mode 100644 index 000000000000..4735083bdea5 --- /dev/null +++ b/tests/Integration/Testing/TestWithoutDatabaseParallelTest.php @@ -0,0 +1,29 @@ +app['config']->set('database.default', null); + + // When we run parallel testing with `without-databases` option + $_SERVER['LARAVEL_PARALLEL_TESTING'] = 1; + $_SERVER['LARAVEL_PARALLEL_TESTING_WITHOUT_DATABASES'] = 1; + $_SERVER['TEST_TOKEN'] = '1'; + + // We should not create a database connection to check if it's SQLite or not. + ParallelTesting::callSetUpProcessCallbacks(); + } +}