dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
myInvoices_integration_test.php File Reference

Go to the source code of this file.

Variables

 $base = dirname(__DIR__, 4)
 Laufzeit- und Transaktionstest des ausführbaren Referenzmoduls.
 $_SERVER ['REQUEST_URI']
 $_SERVER ['HTTP_HOST'] = 'localhost'
 $_SERVER ['HTTPS'] = 'on'
 $_SERVER ['SCRIPT_NAME'] = '/dbxapp/index.php'
 $_SERVER ['REQUEST_METHOD'] = 'GET'
if(!defined( 'dbxSystem')) if (!defined( 'dbxRunAsAdmin'))
 $fail
 $fixtures
 $installed = $fixtures->install(true)
if((int)($installed['ok'] ?? 0) !==1) $db = dbx()->get_system_obj('dbxDB')
 $invoiceDd = 'myInvoices|invoice'
 $itemDd = 'myInvoices|invoiceItem'
 $demo
 $demoId = (int)($demo['id'] ?? 0)
if( $demoId<=0) foreach(array('create_date', 'create_uid', 'update_date', 'update_uid', 'owner',) as $systemField) $items
if(!is_array($items)||count($items) !==2) $calculatedCents = 0
foreach( $items as $item) if($calculatedCents !==4730||(int) round((float) $demo['total_gross'] *100) !==4730) $service
 $positionsHtml = $service->positions()
foreach(array('Positionen zu Rechnung DBX-DEMO-1001', '39, 80 EUR', '7, 50 EUR', '47, 30 EUR', 'Endsumme der Positionen',) as $expected) $reportHtml = $service->report()
foreach(array('DBX-DEMO-1001', 'Endsumme der angezeigten Rechnungen', ' $webApp [modul=myInvoices]dbx_run1=positions &invoice_id=', 'dbxConfirm', 'dbx_token=',) as $expected) = dbx()->get_system_obj('dbxWebApp')
 $deleteUrl
 $deleteRoute = $webApp->action_policy_for_url($deleteUrl)
 $deleteToken = (string)($deleteParams['dbx_token'] ?? '')
if(! $deleteRoute||(string)($deleteRoute['source'] ?? '') !=='automatic'||(string)($deleteRoute['action'] ?? '') !=='dbxAction.delete'||(string)($deleteRoute['bindings']['rid'] ?? '') !==(string) $demoId||!dbx() ->check_action_token((string)($deleteRoute['scope'] ?? ''), $deleteToken)) $tamperedRoute
if(! $tamperedRoute||dbx() ->check_action_token((string)($tamperedRoute['scope'] ?? ''), $deleteToken)) $testNo = 'DBX-TEST-' . date('YmdHis') . '-' . random_int(1000, 9999)
 $inserted
 $testId = (int)$db->_insert_id
if( $inserted !==1) if($db->begin($invoiceDd) !==1) $firstDelete
 $secondDelete
 $deletedHtml = $service->delete()

Variable Documentation

◆ $_SERVER [1/5]

$_SERVER[ 'HTTP_HOST'] = 'localhost'

Definition at line 10 of file myInvoices_integration_test.php.

◆ $_SERVER [2/5]

$_SERVER[ 'HTTPS'] = 'on'

Definition at line 11 of file myInvoices_integration_test.php.

◆ $_SERVER [3/5]

$_SERVER[ 'REQUEST_METHOD'] = 'GET'

Definition at line 13 of file myInvoices_integration_test.php.

◆ $_SERVER [4/5]

$_SERVER[ 'REQUEST_URI']
Initial value:
=
'/dbxapp/?dbx_modul=myInvoices&dbx_run1=report'

Definition at line 8 of file myInvoices_integration_test.php.

◆ $_SERVER [5/5]

$_SERVER[ 'SCRIPT_NAME'] = '/dbxapp/index.php'

Definition at line 12 of file myInvoices_integration_test.php.

◆ $base

$base = dirname(__DIR__, 4)

Laufzeit- und Transaktionstest des ausführbaren Referenzmoduls.

Definition at line 6 of file myInvoices_integration_test.php.

◆ $calculatedCents

if (!is_array( $items)||count( $items) !==2) $calculatedCents = 0

Definition at line 88 of file myInvoices_integration_test.php.

◆ $db

if ((int)( $installed[ 'ok'] ?? 0) !==1) $db = dbx()->get_system_obj('dbxDB')

Definition at line 50 of file myInvoices_integration_test.php.

◆ $deletedHtml

$deletedHtml = $service->delete()

Definition at line 227 of file myInvoices_integration_test.php.

◆ $deleteRoute

$deleteRoute = $webApp->action_policy_for_url($deleteUrl)

Definition at line 145 of file myInvoices_integration_test.php.

◆ $deleteToken

$deleteToken = (string)($deleteParams['dbx_token'] ?? '')

Definition at line 147 of file myInvoices_integration_test.php.

◆ $deleteUrl

$deleteUrl
Initial value:
= dbx()->action_url(
'?dbx_modul=myInvoices&dbx_run1=delete&rid=' . $demoId
)
DBX schema administration.

Definition at line 142 of file myInvoices_integration_test.php.

◆ $demo

$demo
Initial value:
= $db->select1(
array('invoice_no' => 'DBX-DEMO-1001')
)

Definition at line 54 of file myInvoices_integration_test.php.

◆ $demoId

$demoId = (int)($demo['id'] ?? 0)

Definition at line 58 of file myInvoices_integration_test.php.

◆ $fail

$fail
Initial value:
= function (string $message, int $code): void {
fwrite(STDERR, "FAIL: $message\n");
exit($code);
}
exit
Definition index.php:146

Definition at line 25 of file myInvoices_integration_test.php.

◆ $firstDelete

if($inserted !==1) if ( $db->begin( $invoiceDd) !==1) $firstDelete
Initial value:
= $db->delete(
array('invoice_id' => $testId)
)

Definition at line 201 of file myInvoices_integration_test.php.

◆ $fixtures

$fixtures
Initial value:
= dbx()->get_include_obj(
'myInvoicesFixtures',
'myInvoices'
)
Examples
dbx/modules/myInvoices/include/myInvoicesService.class.php.

Definition at line 37 of file myInvoices_integration_test.php.

Referenced by dbx\myInvoices\myInvoicesService\installation().

◆ $inserted

if ( $inserted !==1||$testId<=0) $inserted
Initial value:
= $db->insert($invoiceDd, array(
'invoice_no' => $testNo,
'invoice_date' => '2026-07-20',
'customer' => 'Transaktionstest',
'status' => 'draft',
'total_gross' => '10.00',
))
if(! $tamperedRoute||dbx() ->check_action_token((string)($tamperedRoute['scope'] ?? ''), $deleteToken)) $testNo

Definition at line 174 of file myInvoices_integration_test.php.

◆ $installed

$installed = $fixtures->install(true)

Definition at line 41 of file myInvoices_integration_test.php.

◆ $invoiceDd

$invoiceDd = 'myInvoices|invoice'

Definition at line 51 of file myInvoices_integration_test.php.

◆ $itemDd

$itemDd = 'myInvoices|invoiceItem'

Definition at line 52 of file myInvoices_integration_test.php.

◆ $items

◆ $positionsHtml

$positionsHtml = $service->positions()

Definition at line 107 of file myInvoices_integration_test.php.

◆ $reportHtml

foreach (array( 'Positionen zu Rechnung DBX-DEMO-1001', '39, 80 EUR', '7, 50 EUR', '47, 30 EUR', 'Endsumme der Positionen',) as $expected) $reportHtml = $service->report()

Definition at line 128 of file myInvoices_integration_test.php.

◆ $secondDelete

$secondDelete
Initial value:
= $db->delete(
array('id' => -987654321)
)

Definition at line 205 of file myInvoices_integration_test.php.

◆ $service

foreach($items as $item) if ( $calculatedCents !==4730||(int) round((float) $demo[ 'total_gross'] *100) !==4730) $service
Initial value:
= dbx()->get_include_obj(
'myInvoicesService',
'myInvoices'
)

Definition at line 102 of file myInvoices_integration_test.php.

◆ $tamperedRoute

if (! $deleteRoute||(string)( $deleteRoute[ 'source'] ?? '') !=='automatic'||(string)( $deleteRoute[ 'action'] ?? '') !=='dbxAction.delete'||(string)( $deleteRoute[ 'bindings'][ 'rid'] ?? '') !==(string) $demoId||!dbx() ->check_action_token((string)( $deleteRoute[ 'scope'] ?? ''), $deleteToken)) $tamperedRoute
Initial value:
= $webApp->action_policy_for_url(
'?dbx_modul=myInvoices&dbx_run1=delete&rid=' . ($demoId + 1)
)

Definition at line 161 of file myInvoices_integration_test.php.

◆ $testId

◆ $testNo

if (! $tamperedRoute||dbx() ->check_action_token((string)( $tamperedRoute[ 'scope'] ?? ''), $deleteToken)) $testNo = 'DBX-TEST-' . date('YmdHis') . '-' . random_int(1000, 9999)

Definition at line 173 of file myInvoices_integration_test.php.

◆ $webApp

foreach (array( 'DBX-DEMO-1001', 'Endsumme der angezeigten Rechnungen', ' $webApp[modul=myInvoices]dbx_run1=positions &invoice_id=', 'dbxConfirm', 'dbx_token=',) as $expected) = dbx()->get_system_obj('dbxWebApp')

Definition at line 141 of file myInvoices_integration_test.php.

◆ if

if((int) $db->count($invoiceDd, array('id'=> $testId)) !==0||(int) $db->count($itemDd, array('invoice_id'=> $testId)) !==0||strpos($deletedHtml, 'Rechnung und Positionen wurden gelöscht')===false) ( ! defined 'dbxRunAsAdmin')

Definition at line 18 of file myInvoices_integration_test.php.