You are here

private function PHPUnit_Framework_TestCase::createGlobalStateSnapshot in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/TestCase.php \PHPUnit_Framework_TestCase::createGlobalStateSnapshot()

Parameters

bool $backupGlobals:

Return value

Snapshot

2 calls to PHPUnit_Framework_TestCase::createGlobalStateSnapshot()
PHPUnit_Framework_TestCase::restoreGlobalState in vendor/phpunit/phpunit/src/Framework/TestCase.php
PHPUnit_Framework_TestCase::snapshotGlobalState in vendor/phpunit/phpunit/src/Framework/TestCase.php

File

vendor/phpunit/phpunit/src/Framework/TestCase.php, line 1987

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

private function createGlobalStateSnapshot($backupGlobals) {
  $blacklist = new Blacklist();
  foreach ($this->backupGlobalsBlacklist as $globalVariable) {
    $blacklist
      ->addGlobalVariable($globalVariable);
  }
  if (!defined('PHPUNIT_TESTSUITE')) {
    $blacklist
      ->addClassNamePrefix('PHPUnit');
    $blacklist
      ->addClassNamePrefix('File_Iterator');
    $blacklist
      ->addClassNamePrefix('PHP_CodeCoverage');
    $blacklist
      ->addClassNamePrefix('PHP_Invoker');
    $blacklist
      ->addClassNamePrefix('PHP_Timer');
    $blacklist
      ->addClassNamePrefix('PHP_Token');
    $blacklist
      ->addClassNamePrefix('Symfony');
    $blacklist
      ->addClassNamePrefix('Text_Template');
    $blacklist
      ->addClassNamePrefix('Doctrine\\Instantiator');
    foreach ($this->backupStaticAttributesBlacklist as $class => $attributes) {
      foreach ($attributes as $attribute) {
        $blacklist
          ->addStaticAttribute($class, $attribute);
      }
    }
  }
  return new Snapshot($blacklist, $backupGlobals, $this->backupStaticAttributes, false, false, false, false, false, false, false);
}