24 lines
712 B
PHP
24 lines
712 B
PHP
<?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"); |