You are here

public function PHPUnit_Framework_TestCase::setExpectedException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/TestCase.php \PHPUnit_Framework_TestCase::setExpectedException()

@since Method available since Release 3.2.0

Parameters

mixed $exceptionName:

string $exceptionMessage:

int $exceptionCode:

15 calls to PHPUnit_Framework_TestCase::setExpectedException()
AutoloaderTest::testRegisterWithInvalidCallback in vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php
ContextTest::testAddFails in vendor/sebastian/recursion-context/tests/ContextTest.php
@covers SebastianBergmann\RecursionContext\Context::add @uses SebastianBergmann\RecursionContext\InvalidArgumentException @dataProvider failsProvider
ContextTest::testContainsFails in vendor/sebastian/recursion-context/tests/ContextTest.php
@covers SebastianBergmann\RecursionContext\Context::contains @uses SebastianBergmann\RecursionContext\InvalidArgumentException @dataProvider failsProvider
Framework_MockObject_GeneratorTest::testGetMockForSingletonWithUnserializeFail in vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php
Same as "testGetMockForSingletonWithReflectionSuccess", but we expect warning for PHP < 5.4.0 since PHPUnit will try to execute private __wakeup on unserialize
Framework_MockObject_Matcher_ConsecutiveParametersTest::testIntegrationExpectingException in vendor/phpunit/phpunit-mock-objects/tests/MockObject/Matcher/ConsecutiveParametersTest.php

... See full list

File

vendor/phpunit/phpunit/src/Framework/TestCase.php, line 450

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

public function setExpectedException($exceptionName, $exceptionMessage = '', $exceptionCode = null) {
  $this->expectedException = $exceptionName;
  $this->expectedExceptionMessage = $exceptionMessage;
  $this->expectedExceptionCode = $exceptionCode;
}