File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
tests/Integration/Testing Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,33 @@ protected function getPackageProviders($app)
13
13
return [ParallelTestingServiceProvider::class];
14
14
}
15
15
16
- public function testRunningParallelTestWithoutDatabaseShouldNotCrashOnDefaultConnection ()
16
+ /**
17
+ * Define the test environment.
18
+ *
19
+ * @param \Illuminate\Foundation\Application $app
20
+ * @return void
21
+ */
22
+ protected function defineEnvironment ($ app )
17
23
{
18
24
// Given an application that does not use database connections at all
19
- $ this -> app ['config ' ]->set ('database.default ' , null );
25
+ $ app ['config ' ]->set ('database.default ' , null );
20
26
21
27
// When we run parallel testing with `without-databases` option
22
28
$ _SERVER ['LARAVEL_PARALLEL_TESTING ' ] = 1 ;
23
29
$ _SERVER ['LARAVEL_PARALLEL_TESTING_WITHOUT_DATABASES ' ] = 1 ;
24
30
$ _SERVER ['TEST_TOKEN ' ] = '1 ' ;
25
31
32
+ $ this ->beforeApplicationDestroyed (function () {
33
+ unset(
34
+ $ _SERVER ['LARAVEL_PARALLEL_TESTING ' ],
35
+ $ _SERVER ['LARAVEL_PARALLEL_TESTING_WITHOUT_DATABASES ' ],
36
+ $ _SERVER ['TEST_TOKEN ' ],
37
+ );
38
+ });
39
+ }
40
+
41
+ public function testRunningParallelTestWithoutDatabaseShouldNotCrashOnDefaultConnection ()
42
+ {
26
43
// We should not create a database connection to check if it's SQLite or not.
27
44
ParallelTesting::callSetUpProcessCallbacks ();
28
45
}
You can’t perform that action at this time.
0 commit comments