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\CommandCode
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);
}