function TestCase::iniSet
This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.
@codeCoverageIgnore
Throws
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ TestCase.php, line 1215
Class
- TestCase
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\FrameworkCode
protected function iniSet(string $varName, string $newValue) : void {
$currentValue = ini_set($varName, $newValue);
if ($currentValue !== false) {
$this->iniSettings[$varName] = $currentValue;
}
else {
throw new Exception(sprintf('INI setting "%s" could not be set to "%s".', $varName, $newValue));
}
}