if ('void' === $type) {
$this->voidReturnType = true;
- return;
}
$this->will(function () use ($type) {
switch ($type) {
+ case 'void': return;
case 'string': return '';
case 'float': return 0.0;
case 'int': return 0;
return $this->should(new Prediction\CallTimesPrediction($count));
}
+ /**
+ * Sets call times prediction to the prophecy.
+ *
+ * @see \Prophecy\Prediction\CallTimesPrediction
+ *
+ * @return $this
+ */
+ public function shouldBeCalledOnce()
+ {
+ return $this->shouldBeCalledTimes(1);
+ }
+
/**
* Checks provided prediction immediately.
*
return $this->shouldHave(new Prediction\CallTimesPrediction($count));
}
+ /**
+ * Checks call times prediction.
+ *
+ * @see \Prophecy\Prediction\CallTimesPrediction
+ *
+ * @return $this
+ */
+ public function shouldHaveBeenCalledOnce()
+ {
+ return $this->shouldHaveBeenCalledTimes(1);
+ }
+
/**
* Checks currently registered [with should(...)] prediction.
*/