pricePerSmsRub(99))->toBe('9.00') ->and($p->pricePerSmsRub(100))->toBe('8.50') ->and($p->pricePerSmsRub(249))->toBe('8.50') ->and($p->pricePerSmsRub(250))->toBe('8.30') ->and($p->pricePerSmsRub(500))->toBe('8.10') ->and($p->pricePerSmsRub(999))->toBe('8.10') ->and($p->pricePerSmsRub(1000))->toBe('8.00') ->and($p->pricePerSmsRub(50000))->toBe('8.00') ->and($p->pricePerSmsRub(0))->toBe('9.00'); // volume floored to >=1 }); it('смета = объём × цена ступени', function () { $p = app(ClientSmsPricing::class); // 300 recipients × 1 segment = volume 300 → tier 8.30 → 2490.00 expect($p->estimateRub(300, 1))->toBe('2490.00') // 60 recipients × 2 segments = volume 120 → tier 8.50 → 1020.00 ->and($p->estimateRub(60, 2))->toBe('1020.00') ->and($p->estimateRub(0, 1))->toBe('0.00'); // no recipients → 0 }); it('segments() делегирует калькулятору', function () { $p = app(ClientSmsPricing::class); expect($p->segments('короткий'))->toBe(1); });