stop(); }); $server->start(); $GLOBALS['att_hc_base_url'] = $server->baseUrl(); $GLOBALS['att_hc_db_path'] = $server->dbPath(); try { require __DIR__ . '/server_test.php'; } finally { // Only on failure, and only the interesting lines — the built-in // server logs two access lines per request, which buries anything real. if (count(TestRun::$failures) > 0) { $lines = array_filter( explode("\n", $server->log()), static function (string $l): bool { return trim($l) !== '' && strpos($l, 'Accepted') === false && strpos($l, 'Closing') === false; } ); if ($lines) { echo "\n\033[33mtest server log:\033[0m\n" . implode("\n", array_slice($lines, -40)) . "\n"; } } $server->stop(); } } } report_and_exit();