Mockery\Expectation::andThrowExceptions PHP Method

andThrowExceptions() public method

Set Exception classes to be thrown
public andThrowExceptions ( array $exceptions ) : self
$exceptions array
return self
    public function andThrowExceptions(array $exceptions)
    {
        $this->_throw = true;
        foreach ($exceptions as $exception) {
            if (!is_object($exception)) {
                throw new Exception('You must pass an array of exception objects to andThrowExceptions');
            }
        }
        return $this->andReturnValues($exceptions);
    }

Usage Example

コード例 #1
0
 /**
  * @return $this
  */
 public function andThrowExceptions(array $exceptions)
 {
     $this->expectation->andThrowExceptions($exceptions);
     return $this;
 }