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

Breadcrumb

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

function JunitXmlLogger::name

Throws

InvalidArgumentException

2 calls to JunitXmlLogger::name()
JunitXmlLogger::createTestCase in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php
@psalm-assert !null $this->currentTestCase
JunitXmlLogger::testAsString in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php

File

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

Class

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

Namespace

PHPUnit\Logging\JUnit

Code

private function name(Test $test) : string {
    if ($test->isPhpt()) {
        return basename($test->file());
    }
    assert($test instanceof TestMethod);
    if (!$test->testData()
        ->hasDataFromDataProvider()) {
        return $test->methodName();
    }
    $dataSetName = $test->testData()
        ->dataFromDataProvider()
        ->dataSetName();
    if (is_int($dataSetName)) {
        return sprintf('%s with data set #%d', $test->methodName(), $dataSetName);
    }
    return sprintf('%s with data set "%s"', $test->methodName(), $dataSetName);
}
RSS feed
Powered by Drupal