dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
dbxUpdateFlow_contract_test.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
function
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
20
foreach
(array(
"case 'start':"
,
"case 'stop':"
) as
$contract
) {
21
update_flow_assert
(
22
str_contains(
$controller
,
$contract
),
23
'Controller-Vertrag fehlt: '
.
$contract
24
);
25
}
26
foreach
(array(
27
'public function prepare(): array'
,
28
'public function cancel(): array'
,
29
'private function synchronized(callable $operation): mixed'
,
30
) as
$contract
) {
31
update_flow_assert
(
32
str_contains(
$service
,
$contract
),
33
'Service-Vertrag fehlt: '
.
$contract
34
);
35
}
36
37
foreach
(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) {
48
update_flow_assert
(
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
);
58
update_flow_assert
(
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
);
65
update_flow_assert
(
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
73
echo
"dbxUpdateFlow: automatisches Vorbereiten und sicherer Stop vollständig.\n"
;
$template
$template
Definition
dbxCmsEditorPerformance_contract_test.php:5
$module
$module
Definition
dbxDashboard_default_admin_warning_test.php:5
$controller
$controller
Definition
dbxDashboard_update_status_contract_test.php:20
$service
$service
Definition
dbxDashboard_update_status_contract_test.php:23
$contract
$contract
Definition
dbxKiCmsHeroContract_test.php:57
update_flow_assert
update_flow_assert(bool $condition, string $message)
Definition
dbxUpdateFlow_contract_test.php:5
$fd
foreach( $valid as $email) foreach($invalid as $email) $fd
Definition
dbxValidator_email_test.php:41
dbx
modules
dbxAdmin
tests
dbxUpdateFlow_contract_test.php
Generated by
1.17.0