Я пытаюсь использовать функцию let со скалярными значениями. Моя проблема в том, что цена двойная, я ожидал int 5.
function let(Buyable $buyable, $price, $discount)
{
$buyable->getPrice()->willReturn($price);
$this->beConstructedWith($buyable, $discount);
}
function it_returns_the_same_price_if_discount_is_zero($price = 5, $discount = 0) {
$this->getDiscountPrice()->shouldReturn(5);
}
Ошибка:
✘ it returns the same price if discount is zero
expected [integer:5], but got [obj:Double\stdClass\P14]
есть ли способ ввести 5 с помощью функции let?