30 lines
1.3 KiB
PHP
30 lines
1.3 KiB
PHP
<?php
|
|
|
|
it('guards against empty order ids in net amount calculation', function (): void {
|
|
$ordersFile = app_path('objects/orders_o.php');
|
|
$content = file_get_contents($ordersFile);
|
|
|
|
expect($content)->not->toBeFalse();
|
|
expect($content)->toContain('public function getNetAmountForOrders(array $order_ids): array');
|
|
expect($content)->toContain('if (empty($order_ids)) {');
|
|
expect($content)->toContain('return [];');
|
|
});
|
|
|
|
it('guards against empty customer arrays in date-range transaction fetches', function (): void {
|
|
$ordersFile = app_path('objects/orders_o.php');
|
|
$content = file_get_contents($ordersFile);
|
|
|
|
expect($content)->not->toBeFalse();
|
|
expect($content)->toContain('public function getTransactionsForCustomersInDateRange(array $customers, string $dateFrom, string $dateTo): array');
|
|
expect($content)->toContain('if (empty($customers)) {');
|
|
expect($content)->toContain('return [];');
|
|
});
|
|
|
|
it('uses centralized duplicate filtering for possible duplicate detection', function (): void {
|
|
$ordersFile = app_path('objects/orders_o.php');
|
|
$content = file_get_contents($ordersFile);
|
|
|
|
expect($content)->not->toBeFalse();
|
|
expect($content)->toContain('invoicing_period_utils::filterPossibleDuplicates($orders, 86400)');
|
|
});
|