You are here

public function MethodProphecy::willThrow in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php \Prophecy\Prophecy\MethodProphecy::willThrow()

Sets throw promise to the prophecy.

Parameters

string|\Exception $exception Exception class or instance:

Return value

$this

See also

Prophecy\Promise\ThrowPromise

File

vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php, line 191

Class

MethodProphecy
Method prophecy.

Namespace

Prophecy\Prophecy

Code

public function willThrow($exception) {
  return $this
    ->will(new Promise\ThrowPromise($exception));
}