22 lines
959 B
PHP
22 lines
959 B
PHP
<?php
|
|
|
|
it('does not request e-conomic customer data when customer number is zero', function (): void {
|
|
$usersFile = app_path('objects/users_o.php');
|
|
$content = file_get_contents($usersFile);
|
|
|
|
expect($content)->not->toBeFalse();
|
|
expect($content)->toContain('$customer_number = (int)($customer_number ?? $this->customer_number->value());');
|
|
expect($content)->toContain('if ($customer_number <= 0) {');
|
|
expect($content)->toContain('$this->economic_customer = new economic_customer_mo();');
|
|
expect($content)->toContain('return $this;');
|
|
});
|
|
|
|
it('short-circuits e-conomic customer lookup for non-positive customer numbers', function (): void {
|
|
$customersFile = app_path('modules/economic/customers/economicCustomers.php');
|
|
$content = file_get_contents($customersFile);
|
|
|
|
expect($content)->not->toBeFalse();
|
|
expect($content)->toContain('if ($customerNumber <= 0) {');
|
|
expect($content)->toContain('return false;');
|
|
});
|