23 lines
589 B
PHP
23 lines
589 B
PHP
<?php
|
|
require_once __DIR__ . '/../includes/functions.php';
|
|
|
|
function assertTrue($cond, $msg) {
|
|
if (!$cond) {
|
|
fwrite(STDERR, $msg . PHP_EOL);
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
$projects = getProjectsByCategory('vedette');
|
|
assertTrue(is_array($projects), 'featured projects not array');
|
|
|
|
ob_start();
|
|
foreach ($projects as $project) {
|
|
include __DIR__ . '/../templates/project-card.php';
|
|
}
|
|
$html = ob_get_clean();
|
|
|
|
assertTrue(strpos($html, 'badge') !== false, 'missing badges');
|
|
assertTrue(strpos($html, 'loading="lazy"') !== false, 'missing lazy loading');
|
|
|
|
fwrite(STDOUT, "OK\n"); |