extend(TestCase::class) ->use(RefreshDatabase::class) ->in('Feature'); // A separate invocation is required for the unpublished inventory contract; Feature has a process wrapper. pest()->extend(TestCase::class)->use(RefreshDatabase::class)->in('Conversion'); /* |-------------------------------------------------------------------------- | Expectations |-------------------------------------------------------------------------- | | When you're writing tests, you often need to check that values meet certain conditions. The | "expect()" function gives you access to a set of "expectations" methods that you can use | to assert different things. Of course, you may extend the Expectation API at any time. | */ expect()->extend('toBeOne', function () { return $this->toBe(1); }); /* |-------------------------------------------------------------------------- | Functions |-------------------------------------------------------------------------- | | While Pest is very powerful out-of-the-box, you may have some testing code specific to your | project that you don't want to repeat in every file. Here you can also expose helpers as | global functions to help you to reduce the number of lines of code in your test files. | */ /** * 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).'); } }