dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
shop_demo_notice_config_test.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5$shopRoot = dirname(__DIR__);
6$projectModules = dirname(__DIR__, 2);
7$service = (string)file_get_contents($shopRoot . '/include/dbxShopService.class.php');
8$config = (string)file_get_contents($shopRoot . '/cfg/config.php');
9$admin = (string)file_get_contents($projectModules . '/dbxShop_admin/include/dbxShopAdmin.class.php');
10
11$fail = static function(string $message, int $code): void {
12 fwrite(STDERR, "FAIL: $message\n");
13 exit($code);
14};
15
16if (!str_contains($config, "\$config['demo_notice_enabled'] = true;")) {
17 $fail('Der kompatible Standardwert für den Demo-Hinweis fehlt.', 1);
18}
19if (!str_contains($service, "\$this->settingsBool(\$this->shopConfig(), 'demo_notice_enabled', true)")) {
20 $fail('Das Shop-Frontend wertet den Demo-Hinweis-Schalter nicht zentral aus.', 2);
21}
22if (substr_count($admin, "'demo_notice_enabled'") < 3
23 || !str_contains($admin, 'dbxContentPageCache::invalidateAllFullPages()')) {
24 $fail('Speichern, Formulardaten oder Cache-Invalidierung der Shop-Einstellung fehlen.', 3);
25}
26
27foreach (array('', '_en', '_es') as $suffix) {
28 $fd = (string)file_get_contents(
29 $projectModules . '/dbxShop_admin/fd/shop-settings' . $suffix . '.fd.php'
30 );
31 $template = (string)file_get_contents(
32 $projectModules . '/dbxShop_admin/tpl/htm/shop-settings-form' . $suffix . '.htm'
33 );
34 if (!str_contains($fd, "'demo_notice_enabled'")) {
35 $fail('Sprach-FD enthält den Demo-Hinweis-Schalter nicht: ' . ($suffix ?: '_de'), 4);
36 }
37 if (!str_contains($template, '{obj:demo_notice_enabled}')
38 || !str_contains($template, 'id="{frame_id}"')
39 || str_contains($template, 'id="dbxForm_{i}"')) {
40 $fail('Sprach-Template zeigt den Demo-Hinweis-Schalter nicht: ' . ($suffix ?: '_de'), 5);
41 }
42}
43
44echo "OK shop demo notice configuration\n";
if($resolved !==$expectedBase . 'files/test/') $config
foreach( $valid as $email) foreach($invalid as $email) $fd
exit
Definition index.php:146