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

Breadcrumb

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

function PhptTestCase::parseExternal

Throws

Exception

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

File

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

Class

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

Namespace

PHPUnit\Runner

Code

private function parseExternal(array &$sections) : void {
    $allowSections = [
        'FILE',
        'EXPECT',
        'EXPECTF',
        'EXPECTREGEX',
    ];
    $testDirectory = dirname($this->filename) . DIRECTORY_SEPARATOR;
    foreach ($allowSections as $section) {
        if (isset($sections[$section . '_EXTERNAL'])) {
            $externalFilename = trim($sections[$section . '_EXTERNAL']);
            if (!is_file($testDirectory . $externalFilename) || !is_readable($testDirectory . $externalFilename)) {
                throw new PhptExternalFileCannotBeLoadedException($section, $testDirectory . $externalFilename);
            }
            $sections[$section] = file_get_contents($testDirectory . $externalFilename);
        }
    }
}

API Navigation

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