get('/_phred/health') ->assertOk() ->assertJson([ 'ok' => true, 'framework' => 'Phred' ]); } public function test_not_found(): void { $this->get('/non-existent-route') ->assertNotFound(); } public function test_api_group_auto_mounting(): void { // Disable debug for this assertion to avoid stack traces in 'detail' $originalDebug = getenv('APP_DEBUG'); putenv('APP_DEBUG=false'); try { // /_phred/error is in routes/api.php, so it should have 'api' middleware group. // It returns RFC7807 (Problem Details) because it's NOT JSON:API format by default in this test env. $this->get('/_phred/error') ->assertStatus(500) ->assertJson([ 'title' => 'RuntimeException', 'detail' => 'Boom' ]); } finally { if ($originalDebug !== false) { putenv("APP_DEBUG=$originalDebug"); } else { putenv('APP_DEBUG'); } } } }