You are here

private function PHPUnit_Framework_TestCase::compareGlobalStateSnapshots in Zircon Profile 8

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

Parameters

Snapshot $before:

Snapshot $after:

Throws

PHPUnit_Framework_RiskyTestError

1 call to PHPUnit_Framework_TestCase::compareGlobalStateSnapshots()
PHPUnit_Framework_TestCase::restoreGlobalState in vendor/phpunit/phpunit/src/Framework/TestCase.php

File

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

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after) {
  $backupGlobals = $this->backupGlobals === null || $this->backupGlobals === true;
  if ($backupGlobals) {
    $this
      ->compareGlobalStateSnapshotPart($before
      ->globalVariables(), $after
      ->globalVariables(), "--- Global variables before the test\n+++ Global variables after the test\n");
    $this
      ->compareGlobalStateSnapshotPart($before
      ->superGlobalVariables(), $after
      ->superGlobalVariables(), "--- Super-global variables before the test\n+++ Super-global variables after the test\n");
  }
  if ($this->backupStaticAttributes) {
    $this
      ->compareGlobalStateSnapshotPart($before
      ->staticAttributes(), $after
      ->staticAttributes(), "--- Static attributes before the test\n+++ Static attributes after the test\n");
  }
}