public static function PHPUnit_Util_GlobalState::getConstantsAsString

1 call to PHPUnit_Util_GlobalState::getConstantsAsString()
PHPUnit_Framework_TestCase::run in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php
Runs the test case and collects the results in a TestResult object. If no TestResult object is passed a new one will be created.

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php, line 216

Class

PHPUnit_Util_GlobalState
@package PHPUnit @subpackage Util @author Sebastian Bergmann <sebastian@phpunit.de> @copyright 2001-2013 Sebastian Bergmann <sebastian@phpunit.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause…

Code

public static function getConstantsAsString() {
  $constants = get_defined_constants(TRUE);
  $result = '';
  if (isset($constants['user'])) {
    foreach ($constants['user'] as $name => $value) {
      $result .= sprintf('if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, self::exportVariable($value));
    }
  }
  return $result;
}