dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxSelfTest_menu_viewport_contract_test.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4$base = dirname(__DIR__, 4);
5$failures = array();
6$assert = static function (bool $condition, string $message) use (&$failures): void {
7 if (!$condition) $failures[] = $message;
8};
9
10$menus = array(
11 'dbx-top-admin.htm' => 'System-Selbsttest',
12 'dbx-top-admin_de.htm' => 'System-Selbsttest',
13 'dbx-top-admin_en.htm' => 'System self-test',
14 'dbx-top-admin_es.htm' => 'Autoprueba del sistema',
15 'top-admin-bar.htm' => 'System-Selbsttest',
16 'top-admin-bar_en.htm' => 'System self-test',
17 'top-admin-bar_es.htm' => 'Autoprueba del sistema',
18);
19foreach ($menus as $file => $label) {
20 $html = (string)file_get_contents($base . '/dbx/modules/dbxMenu/tpl/htm/' . $file);
21 $assert(
22 str_contains($html, 'href="?dbx_modul=dbxSelfTest&dbx_run1=dashboard"') && str_contains($html, $label),
23 'dbxSelfTest fehlt oder ist falsch lokalisiert in ' . $file . '.'
24 );
25}
26
27$viewportJs = (string)file_get_contents($base . '/dbx/js/lib/viewport.js');
28$assert(str_contains($viewportJs, 'scrolling="yes"'), 'Das Vorschau-Iframe fordert keinen sichtbaren Scrollbereich an.');
29foreach (array('dbxapp', 'dbxdocs', 'steal') as $design) {
30 $css = (string)file_get_contents($base . '/dbx/design/' . $design . '/css/c-viewport.css');
31 $assert(
32 str_contains($css, '.dbx-viewport-lab .dbx-viewport-toolbar .dbx-viewport-profile-select select')
33 && str_contains($css, '-webkit-text-fill-color: #ffffff'),
34 'Der Auflösungs-Selector ist in ' . $design . ' nicht kontrastfest.'
35 );
36 $assert(
37 str_contains($css, 'html.dbx-viewport-preview-page body.dbx-app .dbx-content::-webkit-scrollbar')
38 && str_contains($css, 'scrollbar-width: auto'),
39 'Der Scrollbalken der Viewport-Vorschau ist in ' . $design . ' nicht sichtbar definiert.'
40 );
41}
42
43if ($failures !== array()) {
44 fwrite(STDERR, "FAIL\n- " . implode("\n- ", $failures) . "\n");
45 exit(1);
46}
47
48echo "OK dbxSelfTest menu localization and viewport accessibility contract.\n";
foreach($menus as $file=> $label) $viewportJs
if(trim($second) !=='second') $design
exit
Definition index.php:146