Ouzo\Utilities\Functions::throwException PHP Method

throwException() public static method

public static throwException ( Exception $exception )
$exception Exception
    public static function throwException(Exception $exception)
    {
        return function () use($exception) {
            throw $exception;
        };
    }

Usage Example

Beispiel #1
0
 /**
  * @param mixed ...
  * @return $this
  */
 public function thenThrow($exception)
 {
     foreach (func_get_args() as $exception) {
         $this->mock->_stubbed_calls[] = new CallStub($this->methodCall, Functions::throwException($exception));
     }
     return $this;
 }
All Usage Examples Of Ouzo\Utilities\Functions::throwException