スカラー値で let 関数を使用しようとしています。私の問題は、価格が Double であることです。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]
let 関数を使用して 5 を注入する方法はありますか?