You are here

public function PHPUnit_Framework_TestFailure::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/TestFailure.php \PHPUnit_Framework_TestFailure::__construct()

Constructs a TestFailure with the given test and exception.

Parameters

PHPUnit_Framework_Test $failedTest:

Exception $thrownException:

File

vendor/phpunit/phpunit/src/Framework/TestFailure.php, line 39

Class

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

Code

public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) {
  if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) {
    $this->testName = $failedTest
      ->toString();
  }
  else {
    $this->testName = get_class($failedTest);
  }
  if (!$failedTest instanceof PHPUnit_Framework_TestCase || !$failedTest
    ->isInIsolation()) {
    $this->failedTest = $failedTest;
  }
  $this->thrownException = $thrownException;
}