refactor(billing-v2): drop balanceLeads from InsufficientBalanceException
This commit is contained in:
@@ -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');
|
||||
});
|
||||
Reference in New Issue
Block a user