Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MethodProphecy.php

function MethodProphecy::willThrow

Sets throw promise to the prophecy.

@phpstan-param class-string<\Throwable>|\Throwable $exception

Parameters

string|\Throwable $exception Exception class or instance:

Return value

$this

See also

\Prophecy\Promise\ThrowPromise

File

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

Class

MethodProphecy
Method prophecy.

Namespace

Prophecy\Prophecy

Code

public function willThrow($exception) {
    return $this->will(new Promise\ThrowPromise($exception));
}
RSS feed
Powered by Drupal