You are here

private function WebAssertTest::assertWrongAssertion in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/tests/WebAssertTest.php \Behat\Mink\Tests\WebAssertTest::assertWrongAssertion()
41 calls to WebAssertTest::assertWrongAssertion()
WebAssertTest::testAddressEquals in vendor/behat/mink/tests/WebAssertTest.php
WebAssertTest::testAddressEqualsEndingInScript in vendor/behat/mink/tests/WebAssertTest.php
WebAssertTest::testAddressMatches in vendor/behat/mink/tests/WebAssertTest.php
WebAssertTest::testAddressNotEquals in vendor/behat/mink/tests/WebAssertTest.php
WebAssertTest::testAddressNotEqualsEndingInScript in vendor/behat/mink/tests/WebAssertTest.php

... See full list

File

vendor/behat/mink/tests/WebAssertTest.php, line 1283

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

private function assertWrongAssertion($assertion, $arguments, $exceptionClass, $exceptionMessage) {
  if ('Behat\\Mink\\Exception\\ExpectationException' !== $exceptionClass && !is_subclass_of($exceptionClass, 'Behat\\Mink\\Exception\\ExpectationException')) {
    throw new \LogicException('Wrong expected exception for the failed assertion. It should be a Behat\\Mink\\Exception\\ExpectationException.');
  }
  try {
    call_user_func_array(array(
      $this->assert,
      $assertion,
    ), $arguments);
    $this
      ->fail('Wrong assertion should throw an exception');
  } catch (ExpectationException $e) {
    $this
      ->assertInstanceOf($exceptionClass, $e);
    $this
      ->assertSame($exceptionMessage, $e
      ->getMessage());
  }
}