Note: The test object is not set when the test is executed in process
isolation.
public failedTest ( ) : PHPUnit_Framework_Test | null | ||
return | PHPUnit_Framework_Test | null |
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count) { $failedTest = $defect->failedTest(); if (!$failedTest instanceof \Codeception\TestCase) { return parent::printDefect($defect, $count); } $this->dispatcher->dispatch('fail.print', new \Codeception\Event\Fail($defect->failedTest(), $defect->thrownException())); }
/** * @param \PHPUnit_Framework_TestFailure $defect * @param integer $count */ protected function printDefectHeader(\PHPUnit_Framework_TestFailure $defect, $count) { $failedTest = $defect->failedTest(); if ($failedTest instanceof \PHPUnit_Framework_SelfDescribing) { $testName = $failedTest->toString(); } else { $testName = get_class($failedTest); } $buffer = sprintf("\n%d) %s\n", $count, $testName); $this->write($buffer); $this->writeResults($buffer); }
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count) { $this->write("\n---------\n"); $this->dispatcher->dispatch(Events::TEST_FAIL_PRINT, new FailEvent($defect->failedTest(), $defect->thrownException(), $count)); }
/** * @param PHPUnit_Framework_TestFailure $defect * @param integer $count * @param boolean $failOrError */ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count, $failOrError = true) { $failedTest = $defect->failedTest(); if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) { $testName = $failedTest->toString(); } else { $testName = get_class($failedTest); } if ($failOrError) { $this->write(sprintf("\n %d) %s", $count, $testName)); } else { $this->write(sprintf(" %s", $this->yellow($testName))); } }
/** * @param PHPUnit_Framework_TestFailure $defect * @param integer $count * @access protected */ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect) { $failedTest = $defect->failedTest(); if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) { $testName = $failedTest->toString(); } else { $testName = get_class($failedTest); } $this->write("<name>{$testName}</name>"); }
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count) { $this->write("\n---------\n"); $this->dispatcher->dispatch('test.fail.print', new \Codeception\Event\Fail($defect->failedTest(), $defect->thrownException(), $count)); }
/** * @param PHPUnit_Framework_TestFailure $defect * @param integer $count * @access protected */ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count) { $failedTest = $defect->failedTest(); if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) { $testName = $failedTest->toString(); } else { $testName = get_class($failedTest); } $this->write(sprintf("<table class='CopixTable'><tr><td>%d</td><td> %s</td></tr>", $count, $testName)); }
/** * @param PHPUnit_Framework_TestFailure $defect * @param integer $count * @access protected */ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count) { $name = $defect->failedTest()->getName(); if ($name == null) { $class = new Reflection_Class($defect->failedTest()); $name = $class->name; } printf("%d) %s\n", $count, $name); }