public static function PHPUnit_Util_GlobalState::getConstantsAsString in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Util/GlobalState.php \PHPUnit_Util_GlobalState::getConstantsAsString()
1 call to PHPUnit_Util_GlobalState::getConstantsAsString()
- PHPUnit_Framework_TestCase::run in vendor/
phpunit/ phpunit/ src/ 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
- vendor/
phpunit/ phpunit/ src/ Util/ GlobalState.php, line 92
Class
- PHPUnit_Util_GlobalState
- @since Class available since Release 3.4.0
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;
}