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

Breadcrumb

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

function HtmlRenderer::reduce

@psalm-return array<string, 'success'|'defect'>

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

File

vendor/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php, line 136

Class

HtmlRenderer
@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();
        if (!isset($result[$prettifiedMethodName])) {
            $result[$prettifiedMethodName] = $test->status()
                ->isSuccess() ? 'success' : 'defect';
            continue;
        }
        if ($test->status()
            ->isSuccess()) {
            continue;
        }
        $result[$prettifiedMethodName] = 'defect';
    }
    return $result;
}

API Navigation

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