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

Breadcrumb

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

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

Exception

Deprecated

https://github.com/sebastianbergmann/phpunit/issues/5214

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\Framework

Code

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));
    }
}

API Navigation

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