✨ Story 3.4: page projet individuelle
This commit is contained in:
21
tests/project-single.test.php
Normal file
21
tests/project-single.test.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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");
|
||||
@@ -12,4 +12,5 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
php (Join-Path $here 'projects.test.php')
|
||||
php (Join-Path $here 'router.test.php')
|
||||
php (Join-Path $here 'projects-list.test.php')
|
||||
php (Join-Path $here 'project-single.test.php')
|
||||
'OK'
|
||||
Reference in New Issue
Block a user