- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
65 lines
2.2 KiB
PHP
65 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
it('can verify complete image system functionality', function () {
|
|
// Test 1: API returns images from database
|
|
$response = curl_exec_with_fallback('https://localhost/api/images', [
|
|
'headers' => ['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;
|
|
}
|
|
} |