['User-Agent: Mozilla/5.0'], 'json' => true, ]); expect($response)->toBeArray(); expect($response['images'])->toBeArray(); expect(count($response['images']))->toBeGreaterThan(10); // Should have many images now $firstImage = $response['images'][0]; expect($firstImage)->toHaveKey('filename'); expect($firstImage)->toHaveKey('url'); expect($firstImage['url'])->toStartWith('/images/'); // Test 2: Admin page loads successfully (no timeout) $adminResponse = curl_exec_with_fallback('https://localhost/admin/images', [ 'headers' => ['User-Agent: Mozilla/5.0'], ]); expect($adminResponse)->toBeString(); expect(strlen($adminResponse))->toBeGreaterThan(1000); // Should be substantial HTML expect($adminResponse)->toContain('Image Management'); // Should contain the page title echo "\n✅ System Status Summary:\n"; echo " API Images: " . count($response['images']) . "\n"; echo " Admin Page: Working\n"; echo " Database: Populated\n"; echo " Sample Image: " . $firstImage['filename'] . "\n"; }); // Helper function for making HTTP requests with working curl options if (! function_exists('curl_exec_with_fallback')) { function curl_exec_with_fallback(string $url, array $options = []): mixed { $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_TIMEOUT => 10, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', CURLOPT_HTTPHEADER => $options['headers'] ?? [], ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode !== 200) { throw new Exception("HTTP $httpCode for $url"); } if (isset($options['json']) && $options['json']) { return json_decode($response, true); } return $response; } }