Skip to content

Commit dc43b3f

Browse files
committed
Extendable Environment Variables in Laravel Test Command
1 parent 3776524 commit dc43b3f

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/Adapters/Laravel/Commands/TestCommand.php

+24-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ public function handle()
9090
),
9191
null,
9292
// Envs ...
93-
$parallel ? [
94-
'LARAVEL_PARALLEL_TESTING' => 1,
95-
'LARAVEL_PARALLEL_TESTING_RECREATE_DATABASES' => $this->option('recreate-databases'),
96-
] : [],
93+
$parallel ? $this->paratestEnvironmentVariables() : $this->phpunitEnvironmentVariables(),
9794
))->setTimeout(null);
9895

9996
try {
@@ -181,6 +178,29 @@ protected function paratestArguments($options)
181178
], $options);
182179
}
183180

181+
/**
182+
* Get the array of environment variables for running PHPUnit.
183+
*
184+
* @return array
185+
*/
186+
protected function phpunitEnvironmentVariables()
187+
{
188+
return [];
189+
}
190+
191+
/**
192+
* Get the array of environment variables for running Paratest.
193+
*
194+
* @return array
195+
*/
196+
protected function paratestEnvironmentVariables()
197+
{
198+
return [
199+
'LARAVEL_PARALLEL_TESTING' => 1,
200+
'LARAVEL_PARALLEL_TESTING_RECREATE_DATABASES' => $this->option('recreate-databases'),
201+
];
202+
}
203+
184204
/**
185205
* Clears any set Environment variables set by Laravel if the --env option is empty.
186206
*

0 commit comments

Comments
 (0)