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:
2026-11-30 23:01:36 +02:00
co-authored by Claude Opus 5.5
parent 7615accf07
commit 8e1e8799a5
16 changed files with 1062 additions and 299 deletions
+3 -3
View File
@@ -1049,7 +1049,7 @@ test('discount evidence and net prices survive award order and printable report'
test('native order preserves common ledger account references without creating a journal or changing the chart', function () {
$source = getenv('RQ01_LEDGER_QA_SOURCE');
if ($source !== 'C:/laragon/www/sgf-tempo/packages/general-ledger') {
if ($source !== sgfTempoPath('packages/general-ledger')) {
$this->markTestSkipped('Dedicated real common-ledger QA schema required.');
}
require_once $source.'/bootstrap.php';
@@ -1077,7 +1077,7 @@ test('native order preserves common ledger account references without creating a
test('native order preserves common ledger across partial and consolidated origins', function (string $mode) {
$source = getenv('RQ01_LEDGER_QA_SOURCE');
if ($source !== 'C:/laragon/www/sgf-tempo/packages/general-ledger' || ! method_exists(BudgetControl::class, 'commitOrderParts')) {
if ($source !== sgfTempoPath('packages/general-ledger') || ! method_exists(BudgetControl::class, 'commitOrderParts')) {
$this->markTestSkipped('Dedicated common ledger and authorised order-parts QA composition required.');
}
require_once $source.'/bootstrap.php';
@@ -1391,7 +1391,7 @@ test('supplier names are frozen at issuance rather than read from live records',
test('print escapes supplied HTML and keeps the development and budget notices', function () {
$this->selection['justification'] = 'Fundamento escrito <script>alert(1)</script> para teste de impressão.';
$order = issuePurchaseOrder($this, selectPurchaseAward($this));
$this->get('/ordens/'.$order->id.'/imprimir')->assertOk()->assertSee('&lt;script&gt;', false)->assertDontSee('<script>alert(1)</script>', false)->assertSee('Orçamento não verificado')->assertSee('Não autoriza compras reais');
$this->get('/ordens/'.$order->id.'/imprimir')->assertOk()->assertSee('&lt;script&gt;', false)->assertDontSee('<script>alert(1)</script>', false)->assertSee('Este documento não preserva confirmação do controlo orçamental')->assertSee('Não autoriza compras reais');
});
test('department heads cannot read or print another departments order', function () {