Réparer les scripts intégrés aux vues
This commit is contained in:
parent
63224d8b06
commit
64ce1285aa
12 changed files with 112 additions and 97 deletions
|
|
@ -337,8 +337,7 @@ if (empty($costs['by_clinic'])):?><span class="text-muted"><?= h(t('statistics.n
|
|||
labels: <?= json_encode(array_map('strval', array_keys($timeline)),
|
||||
JSON_UNESCAPED_UNICODE) ?> ,
|
||||
datasets: [{
|
||||
label: < ? = json_encode(t('statistics.handled'), JSON_UNESCAPED_UNICODE) ?
|
||||
> ,
|
||||
label: <?= json_encode(t('statistics.handled'), JSON_UNESCAPED_UNICODE) ?> ,
|
||||
data: <?= json_encode(array_values(array_map(static fn($s) => (int) $s[
|
||||
'handled'], $timeline))) ?> ,
|
||||
borderColor: '#0ca678',
|
||||
|
|
|
|||
|
|
@ -414,6 +414,22 @@ try {
|
|||
(bool) $db->query('SELECT revoked_at FROM trusted_devices WHERE id=' . (int) $device['id'])->fetchColumn(),
|
||||
);
|
||||
});
|
||||
$test('Les vues ne contiennent aucune balise PHP déformée', function () use ($root, $assert): void {
|
||||
$views = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($root . '/app/Views'));
|
||||
foreach ($views as $view) {
|
||||
if (!$view->isFile() || $view->getExtension() !== 'php') {
|
||||
continue;
|
||||
}
|
||||
$contents = file_get_contents($view->getPathname());
|
||||
$assert($contents !== false, 'Vue illisible : ' . $view->getFilename());
|
||||
foreach (['< ? =', '? >', ' - > '] as $brokenToken) {
|
||||
$assert(
|
||||
!str_contains($contents, $brokenToken),
|
||||
'Syntaxe déformée dans ' . $view->getFilename() . ' : ' . $brokenToken,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
$test('La démonstration installe une fiche Twix complète', function () use ($db, $root, $assert): void {
|
||||
DemoDataService::reset($db);
|
||||
$summary = DemoDataService::seed($db, Auth::id());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue