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

Breadcrumb

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

function PlainTextRenderer::reduce

@psalm-return array<string, 'x'|' '>

1 call to PlainTextRenderer::reduce()
PlainTextRenderer::render in vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php
@psalm-param array<string, TestResultCollection> $tests

File

vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php, line 48

Class

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

Namespace

PHPUnit\Logging\TestDox

Code

private function reduce(TestResultCollection $tests) : array {
    $result = [];
    foreach ($tests as $test) {
        $prettifiedMethodName = $test->test()
            ->testDox()
            ->prettifiedMethodName();
        $success = true;
        if ($test->status()
            ->isError() || $test->status()
            ->isFailure() || $test->status()
            ->isIncomplete() || $test->status()
            ->isSkipped()) {
            $success = false;
        }
        if (!isset($result[$prettifiedMethodName])) {
            $result[$prettifiedMethodName] = $success ? 'x' : ' ';
            continue;
        }
        if ($success) {
            continue;
        }
        $result[$prettifiedMethodName] = ' ';
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal