28 lines
763 B
PHP
28 lines
763 B
PHP
|
|
<?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');
|
||
|
|
});
|