A test started.
public startTest ( PHPUnit_Framework_Test $test ) | ||
$test | PHPUnit_Framework_Test |
public function startTest(\PHPUnit_Framework_Test $test) { if (!$test instanceof Reported) { return parent::startTest($test); } $this->currentTestCase = $this->document->createElement('testcase'); foreach ($test->getReportFields() as $attr => $value) { $this->currentTestCase->setAttribute($attr, $value); } }
public function startTest(\PHPUnit_Framework_Test $test) { if (!$test instanceof Reported) { return parent::startTest($test); } $this->currentTestCase = $this->document->createElement('testcase'); $isStrict = Configuration::config()['settings']['strict_xml']; foreach ($test->getReportFields() as $attr => $value) { if ($isStrict and !in_array($attr, $this->strictAttributes)) { continue; } $this->currentTestCase->setAttribute($attr, $value); } }
public function startTest(\PHPUnit_Framework_Test $test) { if (!$test instanceof \Codeception\TestCase\Cept) { return parent::startTest($test); } $this->currentTestCase = $this->document->createElement('testcase'); if ($test instanceof \Codeception\TestCase\Cept) { $this->currentTestCase->setAttribute('file', $test->getFileName()); return; } if ($test instanceof \Codeception\TestCase) { $class = new \ReflectionClass($test->getTestClass()); $methodName = $test->getTestMethod(); if ($class->hasMethod($methodName)) { $method = $class->getMethod($methodName); $this->currentTestCase->setAttribute('class', $class->getName()); $this->currentTestCase->setAttribute('file', $class->getFileName()); $this->currentTestCase->setAttribute('line', $method->getStartLine()); } } }
public function startTest(PHPUnit_Framework_Test $test) { parent::startTest($test); $this->logger->startTest($test); }