refactor(billing-v2): drop balanceLeads from InsufficientBalanceException

This commit is contained in:
Дмитрий
2026-05-23 12:52:31 +03:00
parent cedf4ae5c4
commit 515741bb42
4 changed files with 37 additions and 9 deletions
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use App\Exceptions\Billing\InsufficientBalanceException;
it('exposes priceKopecks and balanceRub but no balanceLeads', function () {
$e = new InsufficientBalanceException(
priceKopecks: 12000,
balanceRub: '50.00',
);
expect($e->priceKopecks)->toBe(12000);
expect($e->balanceRub)->toBe('50.00');
expect(property_exists($e, 'balanceLeads'))->toBeFalse();
});
it('formats message without balance_leads', function () {
$e = new InsufficientBalanceException(
priceKopecks: 12000,
balanceRub: '50.00',
);
expect($e->getMessage())->not->toContain('balance_leads');
expect($e->getMessage())->toContain('12000');
expect($e->getMessage())->toContain('50.00');
});