Exemplo n.º 1
0
 /**
  * @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));
     }
 }
Exemplo n.º 2
0
 /**
  * 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);
     }
 }
Exemplo n.º 3
0
 function __construct(Stub $stub, $arguments)
 {
     parent::__construct([]);
     $this->stub = $stub;
     $this->arguments = $arguments;
 }