failedTest() public method

Note: The test object is not set when the test is executed in process isolation.
See also: PHPUnit_Framework_Exception
public failedTest ( ) : PHPUnit_Framework_Test | null
return PHPUnit_Framework_Test | null
Esempio n. 1
0
 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);
 }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
 /**
  * @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>");
 }
Esempio n. 6
0
 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));
 }
Esempio n. 8
0
 /**
  * @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);
 }