22 lines
620 B
PHP
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).'
|
|
);
|
|
}
|
|
}
|