mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-14 16:07:52 +00:00
PHP had no regression coverage. Adds a php-app fixture (Composer + Pest) with language, run and debug smoke cases, and a php entry in the Language smoke workflow: PHP 8.5 with Xdebug via setup-php, Intelephense pinned like the other servers. Other languages' selectors are unchanged. Co-authored-by: lleviathe <95321986+lleviathe@users.noreply.github.com>
24 lines
778 B
PHP
24 lines
778 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Shipping\ThresholdCustoms;
|
|
use Tests\TestSupport\ParcelFactory;
|
|
|
|
it('clears a small purchase duty-free', function (): void {
|
|
$charges = new ThresholdCustoms()->assess([ParcelFactory::make(valueCents: 4500)], 1200);
|
|
|
|
expect($charges->isDutyFree())->toBeTrue();
|
|
});
|
|
|
|
it('sums the parcels of one store', function (): void {
|
|
$charges = new ThresholdCustoms()->assess([ParcelFactory::make(valueCents: 6000), ParcelFactory::make(valueCents: 5500)], 2000);
|
|
|
|
expect($charges->vatCents)->toBe(2700)
|
|
->and($charges->feeCents)->toBe(500);
|
|
});
|
|
|
|
it('intentionally fails (set OPENIDEA_FAIL=1)', function (): void {
|
|
expect(1)->toBe(2);
|
|
})->skip(getenv('OPENIDEA_FAIL') !== '1', 'intentionally fails (set OPENIDEA_FAIL=1)');
|