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\RunnerCode
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;
}