Files
portal/app/tests/Unit/Billing/GatewayDtoTest.php
T

22 lines
825 B
PHP

<?php
declare(strict_types=1);
use App\Services\Billing\Gateway\CreatePaymentResult;
use App\Services\Billing\Gateway\WebhookVerifyResult;
it('CreatePaymentResult хранит id платежа и url подтверждения', function () {
$r = new CreatePaymentResult('pay_123', 'https://yoomoney.ru/checkout/pay_123');
expect($r->gatewayPaymentId)->toBe('pay_123')
->and($r->confirmationUrl)->toBe('https://yoomoney.ru/checkout/pay_123');
});
it('WebhookVerifyResult различает успех и прочие статусы', function () {
$ok = new WebhookVerifyResult('pay_123', 'succeeded', '500.00', 'card');
$pending = new WebhookVerifyResult('pay_9', 'pending', '500.00', null);
expect($ok->isSucceeded())->toBeTrue()
->and($pending->isSucceeded())->toBeFalse();
});