startTest() публичный Метод

A test started.
public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test
Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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());
         }
     }
 }
Пример #4
0
 public function startTest(PHPUnit_Framework_Test $test)
 {
     parent::startTest($test);
     $this->logger->startTest($test);
 }