auth tests

This commit is contained in:
Giuseppe Naponiello
2026-06-22 14:31:44 +02:00
parent 34a8ebc6fb
commit cc4e174880
75 changed files with 4679 additions and 168 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace Tests\Feature;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
/**
* Guardia di sicurezza: garantisce che la suite giri sul DB di test dedicato
* (servizio db-test), non sul database di sviluppo `dyncoll`. È volutamente
* read-only (non usa RefreshDatabase): qui assertiamo che l'host e il nome DB
* siano quelli di test. La protezione "dura" che aborta PRIMA di un eventuale
* migrate:fresh sta nel guard beforeRefreshingDatabase() di Tests\TestCase.
*/
class EnvironmentSafetyTest extends TestCase
{
public function test_suite_runs_against_the_dedicated_test_database(): void
{
$this->assertSame('testing', app()->environment());
$this->assertSame('mysql', config('database.default'));
$this->assertSame('db-test', config('database.connections.mysql.host'));
$this->assertSame('dyncoll_test', DB::connection()->getDatabaseName());
}
}