Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / phpspec / prophecy / src / Prophecy / Prophecy / MethodProphecy.php
index 90df1efc8ce5bed079cd7ac4dd03cf7aa4787200..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;
@@ -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.
      *
@@ -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.
      */