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

Breadcrumb

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

function PhptTestCase::validate

1 call to PhptTestCase::validate()
PhptTestCase::parse in vendor/phpunit/phpunit/src/Runner/PhptTestCase.php

File

vendor/phpunit/phpunit/src/Runner/PhptTestCase.php, line 534

Class

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

Namespace

PHPUnit\Runner

Code

private function validate(array $sections) : bool {
    $requiredSections = [
        'FILE',
        [
            'EXPECT',
            'EXPECTF',
            'EXPECTREGEX',
        ],
    ];
    foreach ($requiredSections as $section) {
        if (is_array($section)) {
            $foundSection = false;
            foreach ($section as $anySection) {
                if (isset($sections[$anySection])) {
                    $foundSection = true;
                    break;
                }
            }
            if (!$foundSection) {
                return false;
            }
            continue;
        }
        if (!isset($sections[$section])) {
            return false;
        }
    }
    return true;
}

API Navigation

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