protected function PHPUnit_Framework_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.

@since Method available since Release 3.0.0

Parameters

string $varName:

string $newValue:

Throws

PHPUnit_Framework_Exception

2 calls to PHPUnit_Framework_TestCase::iniSet()
Issue578Test::testNoticesDoublePrintStackTrace in drupal/core/vendor/phpunit/phpunit/Tests/Regression/578/Issue578Test.php
Issue578Test::testWarningsDoublePrintStackTrace in drupal/core/vendor/phpunit/phpunit/Tests/Regression/578/Issue578Test.php

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php, line 1222

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

protected function iniSet($varName, $newValue) {
  if (!is_string($varName)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
  }
  $currentValue = ini_set($varName, $newValue);
  if ($currentValue !== FALSE) {
    $this->iniSettings[$varName] = $currentValue;
  }
  else {
    throw new PHPUnit_Framework_Exception(sprintf('INI setting "%s" could not be set to "%s".', $varName, $newValue));
  }
}