Extract method

This commit is contained in:
Marcus Moore 2024-03-14 16:33:49 -07:00
parent fb64892971
commit a28bee86ba
No known key found for this signature in database

View file

@ -24,11 +24,7 @@ abstract class TestCase extends BaseTestCase
protected function setUp(): void protected function setUp(): void
{ {
if (!file_exists(realpath(__DIR__ . '/../') . '/.env.testing')) { $this->guardAgainstMissingEnv();
throw new RuntimeException(
'.env.testing file does not exist. Aborting to avoid wiping your local database'
);
}
parent::setUp(); parent::setUp();
@ -38,4 +34,13 @@ abstract class TestCase extends BaseTestCase
$this->initializeSettings(); $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.'
);
}
}
} }