You are here

public function Framework_TestCaseTest::testExceptionWithWrongRegexpMessage in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php \Framework_TestCaseTest::testExceptionWithWrongRegexpMessage()

File

vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php, line 235

Class

Framework_TestCaseTest
@since Class available since Release 2.0.0 @covers PHPUnit_Framework_TestCase

Code

public function testExceptionWithWrongRegexpMessage() {
  $test = new ThrowExceptionTestCase('test');
  $test
    ->setExpectedExceptionRegExp('RuntimeException', '/logic .*? occurred/');
  $result = $test
    ->run();
  $this
    ->assertEquals(1, $result
    ->failureCount());
  $this
    ->assertEquals(1, count($result));
  $this
    ->assertEquals("Failed asserting that exception message 'A runtime error occurred' matches '/logic .*? occurred/'.", $test
    ->getStatusMessage());
}