dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
payment_claim_policy_test.php
Go to the documentation of this file.
1
<?php
2
3
require_once dirname(__DIR__) .
'/include/dbxShopRepository.class.php'
;
4
5
$repo
= new \dbx\dbxShop\dbxShopRepository();
6
$method
=
new
ReflectionMethod(
$repo
,
'isStalePaymentProcessing'
);
7
$method
->setAccessible(
true
);
8
$now
= strtotime(
'2026-07-24 12:00:00'
);
9
10
$fail
=
static
function
(
string
$message,
int
$code): void {
11
fwrite(STDERR,
"FAIL: $message\n"
);
12
exit
($code);
13
};
14
15
if
(
$method
->invoke(
$repo
, array(
16
'payment_status'
=>
'created'
,
17
'update_date'
=>
'2026-07-24 11:00:00'
,
18
), 300,
$now
)) {
19
$fail
(
'Ein nicht laufender Status wurde als verwaister Claim bewertet.'
, 1);
20
}
21
22
if
(
$method
->invoke(
$repo
, array(
23
'payment_status'
=>
'processing'
,
24
'update_date'
=>
'2026-07-24 11:59:01'
,
25
), 300,
$now
)) {
26
$fail
(
'Ein frischer processing-Claim wurde zu frueh freigegeben.'
, 2);
27
}
28
29
if
(!
$method
->invoke(
$repo
, array(
30
'payment_status'
=>
'processing'
,
31
'update_date'
=>
'2026-07-24 11:55:00'
,
32
), 300,
$now
)) {
33
$fail
(
'Ein abgelaufener processing-Claim wurde nicht freigegeben.'
, 3);
34
}
35
36
if
(!
$method
->invoke(
$repo
, array(
37
'payment_status'
=>
'PROCESSING'
,
38
'update_date'
=>
'2026-07-24 11:59:00'
,
39
), 1,
$now
)) {
40
$fail
(
'Die Mindest-Leasezeit von 60 Sekunden ist nicht wirksam.'
, 4);
41
}
42
43
if
(
$method
->invoke(
$repo
, array(
44
'payment_status'
=>
'processing'
,
45
'update_date'
=>
''
,
46
), 300,
$now
)) {
47
$fail
(
'Ein Claim ohne belastbaren Zeitstempel wurde freigegeben.'
, 5);
48
}
49
50
echo
"OK shop payment claim policy\n"
;
$fail
$fail
Definition
dbxActionTokenAutomation_test.php:6
$method
$method
Definition
dbxApi_head_response_test.php:7
exit
exit
Definition
index.php:146
$repo
$repo
Definition
payment_claim_policy_test.php:5
$fail
$fail
Definition
payment_claim_policy_test.php:10
$now
$now
Definition
payment_claim_policy_test.php:8
dbx
modules
dbxShop
tests
payment_claim_policy_test.php
Generated by
1.17.0