Skip to content
This repository
Browse code

- Merge [3480].

  • Loading branch information...
commit 1008f482001c719862fd27489dc76a8efeaa81bc 1 parent 9c28d21
Sebastian Bergmann authored

Showing 1 changed file with 52 additions and 15 deletions. Show diff stats Hide diff stats

  1. +52 15 PHPUnit/Tests/Framework/TestCaseTest.php
67 PHPUnit/Tests/Framework/TestCaseTest.php
@@ -60,7 +60,14 @@
60 60 require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TornDown4.php';
61 61 require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'WasRun.php';
62 62
63   -$GLOBALS['foo'] = 'bar';
  63 +$GLOBALS['a'] = 'a';
  64 +$_ENV['b'] = 'b';
  65 +$_POST['c'] = 'c';
  66 +$_GET['d'] = 'd';
  67 +$_COOKIE['e'] = 'e';
  68 +$_SERVER['f'] = 'f';
  69 +$_FILES['g'] = 'g';
  70 +$_REQUEST['h'] = 'h';
64 71
65 72 /**
66 73 *
@@ -209,25 +216,55 @@ public function testWrongException()
209 216
210 217 public function testGlobalsBackupPre()
211 218 {
212   - global $foo;
213   -
  219 + global $a;
  220 +
  221 + $this->assertEquals('a', $a);
  222 + $this->assertEquals('a', $GLOBALS['a']);
  223 + $this->assertEquals('b', $_ENV['b']);
  224 + $this->assertEquals('c', $_POST['c']);
  225 + $this->assertEquals('d', $_GET['d']);
  226 + $this->assertEquals('e', $_COOKIE['e']);
  227 + $this->assertEquals('f', $_SERVER['f']);
  228 + $this->assertEquals('g', $_FILES['g']);
  229 + $this->assertEquals('h', $_REQUEST['h']);
  230 +
  231 + $GLOBALS['a'] = 'aa';
  232 + $GLOBALS['foo'] = 'bar';
  233 + $_ENV['b'] = 'bb';
  234 + $_POST['c'] = 'cc';
  235 + $_GET['d'] = 'dd';
  236 + $_COOKIE['e'] = 'ee';
  237 + $_SERVER['f'] = 'ff';
  238 + $_FILES['g'] = 'gg';
  239 + $_REQUEST['h'] = 'hh';
  240 +
  241 + $this->assertEquals('aa', $a);
  242 + $this->assertEquals('aa', $GLOBALS['a']);
214 243 $this->assertEquals('bar', $GLOBALS['foo']);
215   - $this->assertEquals('bar', $foo);
216   -
217   - $GLOBALS['foo'] = 'baz';
218   - $GLOBALS['bar'] = 'baz';
219   -
220   - $this->assertEquals('baz', $GLOBALS['foo']);
221   - $this->assertEquals('baz', $foo);
  244 + $this->assertEquals('bb', $_ENV['b']);
  245 + $this->assertEquals('cc', $_POST['c']);
  246 + $this->assertEquals('dd', $_GET['d']);
  247 + $this->assertEquals('ee', $_COOKIE['e']);
  248 + $this->assertEquals('ff', $_SERVER['f']);
  249 + $this->assertEquals('gg', $_FILES['g']);
  250 + $this->assertEquals('hh', $_REQUEST['h']);
222 251 }
223 252
224 253 public function testGlobalsBackupPost()
225 254 {
226   - global $foo;
227   -
228   - $this->assertEquals('bar', $GLOBALS['foo']);
229   - $this->assertEquals('bar', $foo);
230   - $this->assertArrayNotHasKey('bar', $GLOBALS);
  255 + global $a;
  256 +
  257 + $this->assertEquals('a', $a);
  258 + $this->assertEquals('a', $GLOBALS['a']);
  259 + $this->assertEquals('b', $_ENV['b']);
  260 + $this->assertEquals('c', $_POST['c']);
  261 + $this->assertEquals('d', $_GET['d']);
  262 + $this->assertEquals('e', $_COOKIE['e']);
  263 + $this->assertEquals('f', $_SERVER['f']);
  264 + $this->assertEquals('g', $_FILES['g']);
  265 + $this->assertEquals('h', $_REQUEST['h']);
  266 +
  267 + $this->assertArrayNotHasKey('foo', $GLOBALS);
231 268 }
232 269
233 270 protected function verifyError(PHPUnit_Framework_TestCase $test)

0 comments on commit 1008f48

Please sign in to comment.
Something went wrong with that request. Please try again.