mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Extract method
This commit is contained in:
parent
fb64892971
commit
a28bee86ba
|
@ -24,11 +24,7 @@ abstract class TestCase extends BaseTestCase
|
|||
|
||||
protected function setUp(): void
|
||||
{
|
||||
if (!file_exists(realpath(__DIR__ . '/../') . '/.env.testing')) {
|
||||
throw new RuntimeException(
|
||||
'.env.testing file does not exist. Aborting to avoid wiping your local database'
|
||||
);
|
||||
}
|
||||
$this->guardAgainstMissingEnv();
|
||||
|
||||
parent::setUp();
|
||||
|
||||
|
@ -38,4 +34,13 @@ abstract class TestCase extends BaseTestCase
|
|||
|
||||
$this->initializeSettings();
|
||||
}
|
||||
|
||||
private function guardAgainstMissingEnv(): void
|
||||
{
|
||||
if (!file_exists(realpath(__DIR__ . '/../') . '/.env.testing')) {
|
||||
throw new RuntimeException(
|
||||
'.env.testing file does not exist. Aborting to avoid wiping your local database.'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue