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

Breadcrumb

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

function PhptTestCase::parseIniSection

Parse --INI-- section key value pairs and return as array.

1 call to PhptTestCase::parseIniSection()
PhptTestCase::run in vendor/phpunit/phpunit/src/Runner/PhptTestCase.php
Runs a test and collects its result in a TestResult instance.

File

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

Class

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

Namespace

PHPUnit\Runner

Code

private function parseIniSection(array|string $content, array $ini = []) : array {
    if (is_string($content)) {
        $content = explode("\n", trim($content));
    }
    foreach ($content as $setting) {
        if (!str_contains($setting, '=')) {
            continue;
        }
        $setting = explode('=', $setting, 2);
        $name = trim($setting[0]);
        $value = trim($setting[1]);
        if ($name === 'extension' || $name === 'zend_extension') {
            if (!isset($ini[$name])) {
                $ini[$name] = [];
            }
            $ini[$name][] = $value;
            continue;
        }
        $ini[$name] = $value;
    }
    return $ini;
}

API Navigation

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