Files
dyncoll-dev/backend/tests/Support/UnsafeTestDatabaseException.php
Giuseppe Naponiello cc4e174880 auth tests
2026-06-22 14:31:44 +02:00

22 lines
620 B
PHP

<?php
namespace Tests\Support;
use RuntimeException;
/**
* Sollevata dal guard del base TestCase quando la suite sta per girare su un
* database che non è quello di test dedicato (`dyncoll_test`): blocca il run
* prima che RefreshDatabase possa azzerare il database di sviluppo.
*/
class UnsafeTestDatabaseException extends RuntimeException
{
public static function for(string $database): self
{
return new self(
"Test isolation guard: connesso al DB '{$database}', atteso 'dyncoll_test'. "
.'Lancia i test con `make test` (punta al servizio db-test).'
);
}
}