Story 4.1: page competences

This commit is contained in:
2026-02-04 17:26:58 +01:00
parent 56b9dad29e
commit 485e3103c5
5 changed files with 135 additions and 31 deletions

23
tests/skills.test.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
require_once __DIR__ . '/../includes/functions.php';
function assertTrue($cond, $msg) {
if (!$cond) {
fwrite(STDERR, $msg . PHP_EOL);
exit(1);
}
}
$counts = getProjectCountByTech();
assertTrue(is_array($counts), 'counts not array');
assertTrue(($counts['PHP'] ?? 0) >= 1, 'expected PHP count');
$projects = getProjectsByTech('PHP');
assertTrue(is_array($projects), 'projectsByTech not array');
assertTrue(count($projects) >= 1, 'expected projects by tech');
$content = file_get_contents(__DIR__ . '/../pages/skills.php');
assertTrue(strpos($content, 'Compétences') !== false, 'skills page missing title');
assertTrue(strpos($content, '/projets?tech=') !== false, 'skills page missing tech links');
fwrite(STDOUT, "OK\n");