toBeTrue(); })->note('The serverStatus accessor now correctly checks only server infrastructure health, not container status'); it('has correct logic in serverStatus accessor', function () { // Read the actual code to verify the fix $reflection = new ReflectionClass(Application::class); $source = file_get_contents($reflection->getFileName()); // Extract just the serverStatus accessor method preg_match('/protected function serverStatus\(\): Attribute\s*\{.*?^\s{4}\}/ms', $source, $matches); $serverStatusCode = $matches[0] ?? ''; expect($serverStatusCode)->not->toBeEmpty('serverStatus accessor should exist'); // Check that the new logic exists (checks isFunctional on each server) expect($serverStatusCode) ->toContain('$main_server_functional = $this->destination?->server?->isFunctional()') ->toContain('foreach ($this->additional_servers as $server)') ->toContain('if (! $server->isFunctional())'); // Check that the old buggy logic is removed from serverStatus accessor expect($serverStatusCode) ->not->toContain('pluck(\'pivot.status\')') ->not->toContain('str($status)->before(\':\')') ->not->toContain('if ($server_status !== \'running\')'); })->note('Verifies that the serverStatus accessor uses the correct logic');