✨ Story 3.5: projets secondaires
This commit is contained in:
24
tests/projects-secondary.test.php
Normal file
24
tests/projects-secondary.test.php
Normal 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");
|
||||
@@ -13,4 +13,5 @@ php (Join-Path $here 'projects.test.php')
|
||||
php (Join-Path $here 'router.test.php')
|
||||
php (Join-Path $here 'projects-list.test.php')
|
||||
php (Join-Path $here 'project-single.test.php')
|
||||
php (Join-Path $here 'projects-secondary.test.php')
|
||||
'OK'
|
||||
Reference in New Issue
Block a user