I have a method in PHP which looks like this:
<?php
class SomeClass
{
public function isEntitledToDiscount(GuestModel $who, $onWhat, &$discountAmount = null)
{
$discountAmount = 10;
return true;
}
}
Is there a way to stub $discountAmount
in PHPSpec? Let's say I have a class I'm testing, and I've injected $someService
via constructor. In my spec I use:
<?php
$someService->isEntitledToDiscount($guest, $ticket, $discountAmount)->willReturn(true);
which creates stub for method return value. How can I do this with the $discountAmount
formal parameter?