= 2, 'expected at least 2 projects'); $featured = getProjectsByCategory('vedette'); assertTrue(count($featured) >= 1, 'expected featured projects'); $found = getProjectBySlug('ecommerce-xyz'); assertTrue(is_array($found), 'project ecommerce-xyz not found'); assertTrue(($found['slug'] ?? '') === 'ecommerce-xyz', 'slug mismatch'); $missing = getProjectBySlug('inexistant'); assertTrue($missing === null, 'missing project should be null'); $missingData = loadJsonData('missing.json'); assertTrue($missingData === [], 'missing.json should return empty array'); $invalidPath = __DIR__ . '/../data/__invalid.json'; file_put_contents($invalidPath, '{invalid json'); $invalidData = loadJsonData('__invalid.json'); @unlink($invalidPath); assertTrue($invalidData === [], 'invalid json should return empty array'); fwrite(STDOUT, "OK\n");