Story 4.5: temoignages

This commit is contained in:
2026-02-04 18:43:54 +01:00
parent c492208939
commit 325625f664
8 changed files with 225 additions and 25 deletions

View File

@@ -19,4 +19,5 @@ php (Join-Path $here 'skills.test.php')
php (Join-Path $here 'tools.test.php')
php (Join-Path $here 'about.test.php')
php (Join-Path $here 'passions.test.php')
php (Join-Path $here 'testimonials.test.php')
'OK'

View File

@@ -0,0 +1,26 @@
<?php
require_once __DIR__ . '/../includes/functions.php';
function assertTrue($cond, $msg) {
if (!$cond) {
fwrite(STDERR, $msg . PHP_EOL);
exit(1);
}
}
$testimonials = getTestimonials();
assertTrue(count($testimonials) === 3, 'expected 3 testimonials');
$featured = getFeaturedTestimonials();
assertTrue(count($featured) === 2, 'expected 2 featured');
$byProject = getTestimonialByProject('ecommerce-xyz');
assertTrue(is_array($byProject), 'missing project testimonial');
$missing = getTestimonialByProject('inexistant');
assertTrue($missing === null, 'expected null for missing testimonial');
$content = file_get_contents(__DIR__ . '/../pages/home.php');
assertTrue(strpos($content, 'Ils m\'ont fait confiance') !== false, 'missing home featured section');
fwrite(STDOUT, "OK\n");