21 lines
810 B
PHP
21 lines
810 B
PHP
<?php
|
|
require_once __DIR__ . '/../includes/functions.php';
|
|
|
|
function assertTrue($cond, $msg) {
|
|
if (!$cond) {
|
|
fwrite(STDERR, $msg . PHP_EOL);
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
$project = getProjectBySlug('ecommerce-xyz');
|
|
assertTrue(is_array($project), 'project not found');
|
|
assertTrue(getProjectBySlug('inexistant') === null, 'missing project should be null');
|
|
|
|
$content = file_get_contents(__DIR__ . '/../pages/project-single.php');
|
|
assertTrue(strpos($content, 'Contexte') !== false, 'missing contexte section');
|
|
assertTrue(strpos($content, 'Solution Technique') !== false, 'missing solution section');
|
|
assertTrue(strpos($content, 'Retour aux projets') !== false, 'missing back link');
|
|
assertTrue(strpos($content, 'badge badge-primary') !== false, 'missing technology badges');
|
|
|
|
fwrite(STDOUT, "OK\n"); |