dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxUpdateFlow_contract_test.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5function update_flow_assert(bool $condition, string $message): void
6{
7 if (!$condition) {
8 throw new RuntimeException($message);
9 }
10}
11
12$module = dirname(__DIR__);
13$controller = (string)file_get_contents(
14 $module . '/include/dbxUpdate.class.php'
15);
16$service = (string)file_get_contents(
17 $module . '/include/dbxUpdateService.class.php'
18);
19
20foreach (array("case 'start':", "case 'stop':") as $contract) {
22 str_contains($controller, $contract),
23 'Controller-Vertrag fehlt: ' . $contract
24 );
25}
26foreach (array(
27 'public function prepare(): array',
28 'public function cancel(): array',
29 'private function synchronized(callable $operation): mixed',
30) as $contract) {
32 str_contains($service, $contract),
33 'Service-Vertrag fehlt: ' . $contract
34 );
35}
36
37foreach (array('', '_en', '_es') as $language) {
38 $fd = (string)file_get_contents(
39 $module . '/fd/admin-update' . $language . '.fd.php'
40 );
41 foreach (array(
42 "\$messages['start_label']",
43 "\$messages['prepare_success']",
44 "\$messages['stop_label']",
45 "\$messages['stop_success']",
46 "\$messages['ready_to_install']",
47 ) as $message) {
49 str_contains($fd, $message),
50 'Sprachmeldung fehlt in admin-update' . $language . '.fd.php: '
51 . $message
52 );
53 }
54
55 $template = (string)file_get_contents(
56 $module . '/tpl/htm/admin-update' . $language . '.htm'
57 );
59 str_contains($template, 'value="start"')
60 && str_contains($template, 'value="install"')
61 && str_contains($template, 'value="stop"'),
62 'Start-/Install-/Stop-Ablauf fehlt in admin-update'
63 . $language . '.htm.'
64 );
66 !str_contains($template, 'value="check"')
67 && !str_contains($template, 'value="stage"'),
68 'Der alte mehrstufige Ablauf ist noch sichtbar in admin-update'
69 . $language . '.htm.'
70 );
71}
72
73echo "dbxUpdateFlow: automatisches Vorbereiten und sicherer Stop vollständig.\n";
update_flow_assert(bool $condition, string $message)
foreach( $valid as $email) foreach($invalid as $email) $fd