Story 3.5: projets secondaires

This commit is contained in:
2026-02-04 17:14:37 +01:00
parent 475a8f5457
commit d3e699d00e
5 changed files with 111 additions and 16 deletions

View File

@@ -0,0 +1,24 @@
<?php
require_once __DIR__ . '/../includes/functions.php';
function assertTrue($cond, $msg) {
if (!$cond) {
fwrite(STDERR, $msg . PHP_EOL);
exit(1);
}
}
$secondary = getProjectsByCategory('secondaire');
assertTrue(count($secondary) >= 1, 'expected secondary projects');
ob_start();
foreach ($secondary as $project) {
include __DIR__ . '/../templates/project-card-compact.php';
}
$html = ob_get_clean();
assertTrue(strpos($html, 'Autres projets') === false, 'template should not include section title');
assertTrue(strpos($html, 'badge') !== false, 'missing tech badges');
assertTrue(strpos($html, 'target="_blank"') !== false, 'missing external link');
fwrite(STDOUT, "OK\n");