30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php
|
|
|
|
it('exposes direct linked order metadata on XL Vask usage order rows', function (): void {
|
|
$route = file_get_contents(WD . '/routes/xlvaskUsageLogsRoute.php');
|
|
|
|
expect($route)->not->toBeFalse();
|
|
|
|
$route = (string)$route;
|
|
|
|
expect($route)
|
|
->toContain('$linked_order_ids_by_wash_id = []')
|
|
->and($route)->toContain('array_key_exists($wash_id, $linked_order_ids_by_wash_id)')
|
|
->and($route)->toContain('selectByWashId($wash_id)')
|
|
->and($route)->toContain("'linked_order_id' => \$linked_order_id")
|
|
->and($route)->toContain("'usage_log_id' => \$id");
|
|
});
|
|
|
|
it('does not execute XL Vask usage automation while listing usage order rows', function (): void {
|
|
$route = file_get_contents(WD . '/routes/xlvaskUsageLogsRoute.php');
|
|
|
|
expect($route)->not->toBeFalse();
|
|
|
|
$route = (string)$route;
|
|
|
|
expect($route)
|
|
->toContain('$automation = $automation_service->evaluateUsageLogRow($log, (int)$user->id, false);')
|
|
->and($route)->not->toContain('$automation = $automation_service->evaluateUsageLogRow($log, (int)$user->id, true);')
|
|
->and($route)->toContain("requirePermission('manage_xlvask_usage_automation')");
|
|
});
|