dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
shop_repository_request_cache_test.php
Go to the documentation of this file.
1
<?php
2
3
$file
= dirname(__DIR__) .
'/include/dbxShopRepository.class.php'
;
4
$repo
= file_get_contents(
$file
);
5
6
$fail
=
static
function
(
string
$message,
int
$code): void {
7
fwrite(STDERR,
"FAIL: $message\n"
);
8
exit
($code);
9
};
10
11
if
(!is_string(
$repo
)) {
12
$fail
(
'Shop-Repository konnte nicht gelesen werden.'
, 1);
13
}
14
15
if
(strpos(
$repo
,
'public function install(bool $maintenance = false): void'
) ===
false
16
|| strpos(
$repo
,
'if (!$maintenance || $maintenanceDone)'
) ===
false
17
|| strpos(
$repo
,
'$this->syncShopSchemaFromDd();'
) ===
false
) {
18
$fail
(
'Schema-/Defaultpflege ist nicht explizit auf den Wartungsmodus begrenzt.'
, 2);
19
}
20
21
if
(strpos(
$repo
,
'private array $requestCache = array();'
) ===
false
22
|| strpos(
$repo
,
'private function remember(string $key, callable $loader): array'
) ===
false
23
|| strpos(
$repo
,
'private function clearRequestCache(): void'
) ===
false
) {
24
$fail
(
'Der request-lokale Referenzcache fehlt.'
, 3);
25
}
26
27
foreach
(array(
'attribute_definitions'
,
'attribute_filter_definitions'
,
'groups'
,
'channels'
) as $key) {
28
if
(strpos(
$repo
,
"\$this->remember('"
. $key .
"'"
) ===
false
) {
29
$fail
(
'Referenzliste wird nicht request-lokal wiederverwendet: '
. $key, 4);
30
}
31
}
32
33
if
(substr_count(
$repo
,
'$this->clearRequestCache();'
) < 8) {
34
$fail
(
'Der Request-Cache wird nach Repository-Mutationen nicht ausreichend invalidiert.'
, 5);
35
}
36
37
echo
"OK shop repository request cache\n"
;
$fail
$fail
Definition
dbxActionTokenAutomation_test.php:6
exit
exit
Definition
index.php:146
$repo
$repo
Definition
payment_claim_policy_test.php:5
$fail
$fail
Definition
shop_repository_request_cache_test.php:6
$file
$file
Definition
shop_repository_request_cache_test.php:3
dbx
modules
dbxShop
tests
shop_repository_request_cache_test.php
Generated by
1.17.0