dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
dbxWizard_generation_test.php
Go to the documentation of this file.
1
<?php
2
3
require_once dirname(__DIR__) .
'/include/dbxWizard.class.php'
;
4
5
$wizard
= new \dbx\dbxAdmin\dbxWizard();
6
$call
=
static
function
($object,
$method
, array $args = array()) {
7
$reflection
=
new
ReflectionMethod($object,
$method
);
8
return
$reflection
->invokeArgs($object, $args);
9
};
10
$assertContains
=
static
function
($needle, $haystack, $label) {
11
if
(strpos((
string
)$haystack, (
string
)$needle) ===
false
) {
12
fwrite(STDERR,
"FAIL: $label\n"
);
13
exit
(1);
14
}
15
};
16
17
$input
= array(
18
'xmodul'
=>
'wizardTest'
,
19
'title'
=>
'Wizard Test'
,
20
'default_run1'
=>
'run'
,
21
'module_template'
=>
'form_report'
,
22
'dd_mode'
=>
'new'
,
23
'dd_name'
=>
'wizardTestData'
,
24
'table_name'
=>
'wizardTestData'
,
25
'db_file'
=>
'wizardTest.db3'
,
26
'field_preset'
=>
'basic'
,
27
'create_include'
=> 1,
28
'create_form'
=> 1,
29
'create_report'
=> 1,
30
'create_templates'
=> 1,
31
);
32
33
$dd
=
$call
(
$wizard
,
'generate_dd'
, array(
$input
));
34
$assertContains
(
"\$table['primary']='id';"
,
$dd
,
'DD primary key'
);
35
$assertContains
(
"\$field['name']='owner';"
,
$dd
,
'DD owner field'
);
36
$assertContains
(
"\$field['name']='trash';"
,
$dd
,
'DD trash field'
);
37
38
$formTemplate
=
$call
(
$wizard
,
'generate_form_template'
);
39
$assertContains
(
'[dbx:form]'
,
$formTemplate
,
'form field placeholder'
);
40
$assertContains
(
'{obj:form_msg}'
,
$formTemplate
,
'form message placeholder'
);
41
42
$reportTemplate
=
$call
(
$wizard
,
'generate_report_template'
);
43
$assertContains
(
'[tpl=dbx|report-shell-head]'
,
$reportTemplate
,
'report shell header'
);
44
$assertContains
(
'[rpt:row]'
,
$reportTemplate
,
'report row placeholder'
);
45
46
$service
=
$call
(
$wizard
,
'generate_service_class'
, array(
$input
));
47
$assertContains
(
"add_rep('bar_title', 'Datensaetze')"
,
$service
,
'report title setup'
);
48
$assertContains
(
'Felder ausfuellen und mit Speichern uebernehmen.'
,
$service
,
'form help text'
);
49
50
echo
"OK dbxWizard generation\n"
;
$method
$method
Definition
dbxApi_head_response_test.php:7
$reflection
$reflection
Definition
dbxContent_cms_hero_contract_test.php:42
$service
$service
Definition
dbxDashboard_update_status_contract_test.php:23
$dd
$dd
Definition
dbxMediaUsageLanguage_contract_test.php:10
$reportTemplate
$reportTemplate
Definition
dbxWizard_generation_test.php:42
$assertContains
$assertContains
Definition
dbxWizard_generation_test.php:10
$wizard
$wizard
Definition
dbxWizard_generation_test.php:5
$call
$call
Definition
dbxWizard_generation_test.php:6
$input
$input
Definition
dbxWizard_generation_test.php:17
$formTemplate
$formTemplate
Definition
dbxWizard_generation_test.php:38
exit
exit
Definition
index.php:146
dbx
modules
dbxAdmin
tests
dbxWizard_generation_test.php
Generated by
1.17.0