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

Breadcrumb

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

function ListTestsAsTextCommand::execute

Overrides Command::execute

File

vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php, line 35

Class

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

Namespace

PHPUnit\TextUI\Command

Code

public function execute() : Result {
    $buffer = $this->warnAboutConflictingOptions();
    $buffer .= 'Available test(s):' . PHP_EOL;
    foreach (new RecursiveIteratorIterator($this->suite) as $test) {
        if ($test instanceof TestCase) {
            $name = sprintf('%s::%s', $test::class, str_replace(' with data set ', '', $test->nameWithDataSet()));
        }
        elseif ($test instanceof PhptTestCase) {
            $name = $test->getName();
        }
        else {
            continue;
        }
        $buffer .= sprintf(' - %s' . PHP_EOL, $name);
    }
    return Result::from($buffer);
}
RSS feed
Powered by Drupal