14$ajaxFile =
$dbxRoot . DIRECTORY_SEPARATOR .
'js' . DIRECTORY_SEPARATOR .
'lib' . DIRECTORY_SEPARATOR .
'ajax.js';
15$confirmFile =
$dbxRoot . DIRECTORY_SEPARATOR .
'js' . DIRECTORY_SEPARATOR .
'lib' . DIRECTORY_SEPARATOR .
'confirm.js';
17 . DIRECTORY_SEPARATOR .
'tpl' . DIRECTORY_SEPARATOR .
'htm' . DIRECTORY_SEPARATOR .
'shop-cart-report.htm';
19 . DIRECTORY_SEPARATOR .
'tpl' . DIRECTORY_SEPARATOR .
'htm' . DIRECTORY_SEPARATOR .
'start.htm';
21 . DIRECTORY_SEPARATOR .
'design' . DIRECTORY_SEPARATOR .
'js' . DIRECTORY_SEPARATOR .
'shop.js';
23 . DIRECTORY_SEPARATOR .
'include' . DIRECTORY_SEPARATOR .
'dbxShopService.class.php';
33if (strpos(
$ajax,
'submitSource: e.submitter || null') ===
false) {
34 $errors[] =
'ajax.js übernimmt SubmitEvent.submitter nicht.';
37if (strpos(
$ajax,
'body.set(ctx.submitName, ctx.submitValue)') ===
false) {
38 $errors[] =
'ajax.js schreibt name/value des Submitters nicht in FormData.';
41if (strpos(
$confirm,
'form.requestSubmit(source)') ===
false) {
42 $errors[] =
'confirm.js setzt bestätigte Formularaktionen nicht mit ihrem Submitter fort.';
45if (strpos(
$confirm,
'dbx.ajax.run(ajaxRoot') !==
false) {
46 $errors[] =
'confirm.js umgeht den regulären Formular-Submit.';
49if (strpos(
$confirm,
'data-dbx-confirm-submitter') ===
false
50 || strpos(
$confirm,
'form.appendChild(submitProxy)') ===
false) {
51 $errors[] =
'confirm.js erhält name/value bestätigter Submitter nicht im Formular.';
54if (strpos(
$cart,
'name="clear"') ===
false) {
55 $errors[] =
'Warenkorb-Template enthält name="clear" nicht.';
59 $errors[] =
'Warenkorb-Report enthält name="remove" nicht.';
62if (strpos(
$cart,
'data-dbx-shop-cart-count="{cart_count}"') ===
false
63 || strpos(
$shopService,
"add_rep('cart_count'") ===
false) {
64 $errors[] =
'Warenkorb-Report veröffentlicht den aktuellen Menüzähler nicht.';
67if (!preg_match(
'#dbxShop/design/js/shop\.js\?v=\d+#',
$shopStart)
68 || strpos(
$shopJs,
'window.dbx.event.on("ajax:after"') ===
false) {
69 $errors[] =
'Shop-Menüzähler wird nach AJAX-Aktionen nicht synchronisiert.';
73 fwrite(STDERR, implode(PHP_EOL,
$errors) . PHP_EOL);
77echo
"OK dbxAjax_submitter_test" . PHP_EOL;
$dbxRoot
Regressionstest für benannte Submit-Schaltflächen in AJAX-Formularen.