Files
portal/app/tests/Unit/Advertising/AdMarkupTest.php
T

15 lines
476 B
PHP

<?php
declare(strict_types=1);
use App\Services\Advertising\AdMarkup;
it('applies 30% markup: client sees x1.3, yandex gets /1.3', function () {
$m = new AdMarkup('30.00');
// click price: Yandex 12.18 -> client 15.83 (12.18*1.3=15.834, truncated to 15.83)
expect($m->clientFromYandex('12.18'))->toBe('15.83');
// budget: client 500 -> Yandex 384.61 (500/1.3=384.615..., truncated to 384.61)
expect($m->yandexFromClient('500.00'))->toBe('384.61');
});