Documentation

PHPUnit_Framework_TestFailure
in package

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

Tags
since

Class available since Release 2.0.0

Table of Contents

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

Properties

$thrownException

protected Exception $thrownException

Methods

exceptionMessage()

Returns the exception's message.

public exceptionMessage() : string
Return values
string

exceptionToString()

Returns a description for an exception.

public static exceptionToString(Exception $e) : string
Parameters
$e : Exception
Tags
since

Method available since Release 3.2.0

Return values
string

getExceptionAsString()

Returns a description for the thrown exception.

public getExceptionAsString() : string
Tags
since

Method available since Release 3.4.0

Return values
string

getTestName()

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

public getTestName() : string
Tags
since

Method available since Release 4.3.0

Return values
string

isFailure()

Returns true if the thrown exception is of type AssertionFailedError.

public isFailure() : bool
Return values
bool

thrownException()

Gets the thrown exception.

public thrownException() : Exception
Return values
Exception

toString()

Returns a short description of the failure.

public toString() : string
Return values
string

Search results