class (none) \ PHPUnit_Framework_TestFailure


A TestFailure collects a failed test together with the caught exception.


Method Summary

Name Description
__construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException)Constructs a TestFailure with the given test and exception.
exceptionMessage()Returns the exception's message.
exceptionToString(Exception $e)Returns a description for an exception.
failedTest()Returns the failing test.
getExceptionAsString()Returns a description for the thrown exception.
getTestName()Returns the name of the failing test (including data set, if any).
isFailure()Returns true if the thrown exception is of type AssertionFailedError.
thrownException()Gets the thrown exception.
toString()Returns a short description of the failure.

public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException)

Constructs a TestFailure with the given test and exception.

Parameters:
PHPUnit_Framework_Test - $failedTest
Exception - $thrownException

public function exceptionMessage()

Returns the exception's message.

Returns:
string

public static function exceptionToString(Exception $e)

Returns a description for an exception.

Parameters:
Exception - $e
Returns:
string

public function failedTest()

Returns the failing test.

Note: The test object is not set when the test is executed in process isolation.

Returns:
PHPUnit_Framework_Test|null
See Also:
PHPUnit_Framework_Exception

public function getExceptionAsString()

Returns a description for the thrown exception.

Returns:
string

public function getTestName()

Returns the name of the failing test (including data set, if any).

Returns:
string

public function isFailure()

Returns true if the thrown exception is of type AssertionFailedError.

Returns:
boolean

public function thrownException()

Gets the thrown exception.

Returns:
Exception

public function toString()

Returns a short description of the failure.

Returns:
string