You are here

public function Framework_TestCaseTest::testGlobalsBackupPost in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php \Framework_TestCaseTest::testGlobalsBackupPost()

File

vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php, line 333

Class

Framework_TestCaseTest
@since Class available since Release 2.0.0 @covers PHPUnit_Framework_TestCase

Code

public function testGlobalsBackupPost() {
  global $a;
  global $i;
  $this
    ->assertEquals('a', $a);
  $this
    ->assertEquals('a', $GLOBALS['a']);
  $this
    ->assertEquals('b', $_ENV['b']);
  $this
    ->assertEquals('c', $_POST['c']);
  $this
    ->assertEquals('d', $_GET['d']);
  $this
    ->assertEquals('e', $_COOKIE['e']);
  $this
    ->assertEquals('f', $_SERVER['f']);
  $this
    ->assertEquals('g', $_FILES['g']);
  $this
    ->assertEquals('h', $_REQUEST['h']);
  $this
    ->assertEquals('ii', $i);
  $this
    ->assertEquals('ii', $GLOBALS['i']);
  $this
    ->assertArrayNotHasKey('foo', $GLOBALS);
}