Pull merge.
[yaffs-website] / vendor / phpspec / prophecy / src / Prophecy / Prophecy / MethodProphecy.php
index 5c0ede9a66d79939e7319198578fb911bf11bdae..7084ed6f379f401377af7fbea5c4cc9d52c44656 100644 (file)
@@ -75,11 +75,11 @@ class MethodProphecy
 
             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;
@@ -164,7 +164,7 @@ class MethodProphecy
     /**
      * Sets return promise to the prophecy.
      *
-     * @see Prophecy\Promise\ReturnPromise
+     * @see \Prophecy\Promise\ReturnPromise
      *
      * @return $this
      */
@@ -185,7 +185,7 @@ class MethodProphecy
      *
      * @param int $index The zero-indexed number of the argument to return
      *
-     * @see Prophecy\Promise\ReturnArgumentPromise
+     * @see \Prophecy\Promise\ReturnArgumentPromise
      *
      * @return $this
      */
@@ -201,7 +201,7 @@ class MethodProphecy
     /**
      * Sets throw promise to the prophecy.
      *
-     * @see Prophecy\Promise\ThrowPromise
+     * @see \Prophecy\Promise\ThrowPromise
      *
      * @param string|\Exception $exception Exception class or instance
      *
@@ -243,7 +243,7 @@ class MethodProphecy
     /**
      * Sets call prediction to the prophecy.
      *
-     * @see Prophecy\Prediction\CallPrediction
+     * @see \Prophecy\Prediction\CallPrediction
      *
      * @return $this
      */
@@ -255,7 +255,7 @@ class MethodProphecy
     /**
      * Sets no calls prediction to the prophecy.
      *
-     * @see Prophecy\Prediction\NoCallsPrediction
+     * @see \Prophecy\Prediction\NoCallsPrediction
      *
      * @return $this
      */
@@ -267,7 +267,7 @@ class MethodProphecy
     /**
      * Sets call times prediction to the prophecy.
      *
-     * @see Prophecy\Prediction\CallTimesPrediction
+     * @see \Prophecy\Prediction\CallTimesPrediction
      *
      * @param $count
      *
@@ -278,6 +278,18 @@ class MethodProphecy
         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.
      *
@@ -324,7 +336,7 @@ class MethodProphecy
     /**
      * Checks call prediction.
      *
-     * @see Prophecy\Prediction\CallPrediction
+     * @see \Prophecy\Prediction\CallPrediction
      *
      * @return $this
      */
@@ -336,7 +348,7 @@ class MethodProphecy
     /**
      * Checks no calls prediction.
      *
-     * @see Prophecy\Prediction\NoCallsPrediction
+     * @see \Prophecy\Prediction\NoCallsPrediction
      *
      * @return $this
      */
@@ -348,7 +360,7 @@ class MethodProphecy
     /**
      * Checks no calls prediction.
      *
-     * @see Prophecy\Prediction\NoCallsPrediction
+     * @see \Prophecy\Prediction\NoCallsPrediction
      * @deprecated
      *
      * @return $this
@@ -361,7 +373,7 @@ class MethodProphecy
     /**
      * Checks call times prediction.
      *
-     * @see Prophecy\Prediction\CallTimesPrediction
+     * @see \Prophecy\Prediction\CallTimesPrediction
      *
      * @param int $count
      *
@@ -372,6 +384,18 @@ class MethodProphecy
         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.
      */