Tornar a suite de testes portável e alinhada com o código
- sgfTempoPath(): substitui caminhos C:/laragon fixos (SGF_TEMPO_ROOT, por omissão a pasta irmã sgf-tempo, igual ao Laragon). - skipUnlessIsolatedPostgres(): testes que exigem a base QA PostgreSQL isolada passam a ser ignorados com motivo em SQLite em vez de rebentar. - Artefacto de distribuição orçamental gerado localmente: ignorado se ausente. - Páginas públicas /consulta e /proposta: testes alinhados com os redireccionamentos para os módulos reais (decisão de 29/11). - Impressão da ordem: texto do aviso orçamental actualizado. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+18
-2
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
|
||||
/*
|
||||
@@ -47,7 +48,22 @@ expect()->extend('toBeOne', function () {
|
||||
|
|
||||
*/
|
||||
|
||||
function something()
|
||||
/**
|
||||
* Root of the sibling SGF checkout (common finance sources), portable across machines.
|
||||
* Defaults to the folder next to this repository, e.g. C:/laragon/www/sgf-tempo on Laragon.
|
||||
*/
|
||||
function sgfTempoPath(string $relative = ''): string
|
||||
{
|
||||
// ..
|
||||
$root = getenv('SGF_TEMPO_ROOT') ?: dirname(__DIR__, 2).'/sgf-tempo';
|
||||
$path = rtrim(str_replace('\\', '/', $root), '/');
|
||||
|
||||
return $relative === '' ? $path : $path.'/'.ltrim($relative, '/');
|
||||
}
|
||||
|
||||
/** Tests that assert the identity of an isolated PostgreSQL QA database cannot run on SQLite. */
|
||||
function skipUnlessIsolatedPostgres(PHPUnit\Framework\TestCase $test): void
|
||||
{
|
||||
if (DB::connection()->getDriverName() !== 'pgsql') {
|
||||
$test->markTestSkipped('Requires the isolated PostgreSQL QA database (see tests/Concurrency).');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user