function TestCase::createGlobalStateSnapshot
2 calls to TestCase::createGlobalStateSnapshot()
- TestCase::restoreGlobalState in vendor/
phpunit/ phpunit/ src/ Framework/ TestCase.php - TestCase::snapshotGlobalState in vendor/
phpunit/ phpunit/ src/ Framework/ TestCase.php
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ TestCase.php, line 1803
Class
- TestCase
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\FrameworkCode
private function createGlobalStateSnapshot(bool $backupGlobals) : Snapshot {
$excludeList = new GlobalStateExcludeList();
foreach ($this->backupGlobalsExcludeList as $globalVariable) {
$excludeList->addGlobalVariable($globalVariable);
}
if (!defined('PHPUNIT_TESTSUITE')) {
$excludeList->addClassNamePrefix('PHPUnit');
$excludeList->addClassNamePrefix('SebastianBergmann\\CodeCoverage');
$excludeList->addClassNamePrefix('SebastianBergmann\\FileIterator');
$excludeList->addClassNamePrefix('SebastianBergmann\\Invoker');
$excludeList->addClassNamePrefix('SebastianBergmann\\Template');
$excludeList->addClassNamePrefix('SebastianBergmann\\Timer');
$excludeList->addStaticProperty(ComparatorFactory::class, 'instance');
foreach ($this->backupStaticPropertiesExcludeList as $class => $properties) {
foreach ($properties as $property) {
$excludeList->addStaticProperty($class, $property);
}
}
}
return new Snapshot($excludeList, $backupGlobals, (bool) $this->backupStaticProperties, false, false, false, false, false, false, false);
}