mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-17 14:25:21 +00:00
The Modules/HelloWorld integration test needs the module enabled at the nwidart level, read from storage/app/modules_statuses.json at app boot. That file is gitignored (created locally by `module:make`), so it's absent on CI and fresh clones — HelloWorld stays disabled and the 5 integration tests fail with 404s. Provision it (only if missing) in tests/Pest.php before any test boots the app, so CI matches a local dev environment. Full suite: 462 pass.
20 lines
924 B
PHP
20 lines
924 B
PHP
<?php
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
// The Modules/HelloWorld integration test needs the module enabled at the
|
|
// nwidart level, which is read from storage/app/modules_statuses.json when the
|
|
// app boots. That file is gitignored (created locally by `module:make`), so it
|
|
// is absent in CI and fresh clones — leaving HelloWorld disabled and the
|
|
// integration test failing with 404s. Provision it (only if missing) before any
|
|
// test boots the application, so CI matches a local dev environment.
|
|
$modulesStatuses = __DIR__.'/../storage/app/modules_statuses.json';
|
|
if (! is_file($modulesStatuses)) {
|
|
@mkdir(dirname($modulesStatuses), 0755, true);
|
|
file_put_contents($modulesStatuses, json_encode(['HelloWorld' => true], JSON_PRETTY_PRINT).PHP_EOL);
|
|
}
|
|
|
|
uses(TestCase::class, RefreshDatabase::class)->in('Feature');
|
|
uses(TestCase::class, RefreshDatabase::class)->in('Unit');
|