/** * @param int $index * @return CallAssertion * @throws AssertionFailedException */ public function inCall($index) { try { return new CallAssertion($this->methodCall, $this->history->inCall($index)); } catch (\InvalidArgumentException $e) { throw new AssertionFailedException($e->getMessage() . "\n" . (new HistoryPrinter())->printAll($this->mockster)); } }
/** * Records the invocation of the method. * * @param array $arguments * @param mixed $returnValue * @param \Exception $thrown * @throws \ReflectionException */ public function record($arguments, $returnValue, \Exception $thrown = null) { $this->history->add(new Call($this->named($arguments), $returnValue, $thrown)); if (!$this->checkReturnType) { return; } if ($thrown) { $this->checkException($thrown); } else { $this->checkReturnValue($returnValue); } }
function __construct(Stub $stub, $arguments) { parent::__construct([]); $this->stub = $stub; $this->arguments = $arguments; }