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;
/**
* Sets return promise to the prophecy.
*
- * @see Prophecy\Promise\ReturnPromise
+ * @see \Prophecy\Promise\ReturnPromise
*
* @return $this
*/
*
* @param int $index The zero-indexed number of the argument to return
*
- * @see Prophecy\Promise\ReturnArgumentPromise
+ * @see \Prophecy\Promise\ReturnArgumentPromise
*
* @return $this
*/
/**
* Sets throw promise to the prophecy.
*
- * @see Prophecy\Promise\ThrowPromise
+ * @see \Prophecy\Promise\ThrowPromise
*
* @param string|\Exception $exception Exception class or instance
*
/**
* Sets call prediction to the prophecy.
*
- * @see Prophecy\Prediction\CallPrediction
+ * @see \Prophecy\Prediction\CallPrediction
*
* @return $this
*/
/**
* Sets no calls prediction to the prophecy.
*
- * @see Prophecy\Prediction\NoCallsPrediction
+ * @see \Prophecy\Prediction\NoCallsPrediction
*
* @return $this
*/
/**
* Sets call times prediction to the prophecy.
*
- * @see Prophecy\Prediction\CallTimesPrediction
+ * @see \Prophecy\Prediction\CallTimesPrediction
*
* @param $count
*
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.
*
/**
* Checks call prediction.
*
- * @see Prophecy\Prediction\CallPrediction
+ * @see \Prophecy\Prediction\CallPrediction
*
* @return $this
*/
/**
* Checks no calls prediction.
*
- * @see Prophecy\Prediction\NoCallsPrediction
+ * @see \Prophecy\Prediction\NoCallsPrediction
*
* @return $this
*/
/**
* Checks no calls prediction.
*
- * @see Prophecy\Prediction\NoCallsPrediction
+ * @see \Prophecy\Prediction\NoCallsPrediction
* @deprecated
*
* @return $this
/**
* Checks call times prediction.
*
- * @see Prophecy\Prediction\CallTimesPrediction
+ * @see \Prophecy\Prediction\CallTimesPrediction
*
* @param int $count
*
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.
*/