auth tests
This commit is contained in:
21
backend/tests/Support/UnsafeTestDatabaseException.php
Normal file
21
backend/tests/Support/UnsafeTestDatabaseException.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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).'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user