Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JunitXmlLogger.php

function JunitXmlLogger::createTestCase

@psalm-assert !null $this->currentTestCase

Throws

InvalidArgumentException

3 calls to JunitXmlLogger::createTestCase()
JunitXmlLogger::handleFault in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php
JunitXmlLogger::handleIncompleteOrSkipped in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php
JunitXmlLogger::testPreparationStarted in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php

File

vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php, line 426

Class

JunitXmlLogger
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Logging\JUnit

Code

private function createTestCase(Errored|Failed|MarkedIncomplete|PreparationStarted|Prepared|Skipped $event) : void {
    $testCase = $this->document
        ->createElement('testcase');
    $test = $event->test();
    $testCase->setAttribute('name', $this->name($test));
    $testCase->setAttribute('file', $test->file());
    if ($test->isTestMethod()) {
        assert($test instanceof TestMethod);
        $testCase->setAttribute('line', (string) $test->line());
        $testCase->setAttribute('class', $test->className());
        $testCase->setAttribute('classname', str_replace('\\', '.', $test->className()));
    }
    $this->currentTestCase = $testCase;
    $this->time = $event->telemetryInfo()
        ->time();
}
RSS feed
Powered by Drupal