26 lines
816 B
PHP
26 lines
816 B
PHP
<?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"); |