1<?php 2/** 3 * @runTestsInSeparateProcesses 4 * @preserveGlobalState enabled 5 */ 6class Issue1335Test extends PHPUnit_Framework_TestCase 7{ 8 public function testGlobalString() 9 { 10 $this->assertEquals('Hello', $GLOBALS['globalString']); 11 } 12 13 public function testGlobalIntTruthy() 14 { 15 $this->assertEquals(1, $GLOBALS['globalIntTruthy']); 16 } 17 18 public function testGlobalIntFalsey() 19 { 20 $this->assertEquals(0, $GLOBALS['globalIntFalsey']); 21 } 22 23 public function testGlobalFloat() 24 { 25 $this->assertEquals(1.123, $GLOBALS['globalFloat']); 26 } 27 28 public function testGlobalBoolTrue() 29 { 30 $this->assertTrue($GLOBALS['globalBoolTrue']); 31 } 32 33 public function testGlobalBoolFalse() 34 { 35 $this->assertFalse($GLOBALS['globalBoolFalse']); 36 } 37 38 public function testGlobalNull() 39 { 40 $this->assertEquals(null, $GLOBALS['globalNull']); 41 } 42 43 public function testGlobalArray() 44 { 45 $this->assertEquals(['foo'], $GLOBALS['globalArray']); 46 } 47 48 public function testGlobalNestedArray() 49 { 50 $this->assertEquals([['foo']], $GLOBALS['globalNestedArray']); 51 } 52 53 public function testGlobalObject() 54 { 55 $this->assertEquals((object) ['foo'=> 'bar'], $GLOBALS['globalObject']); 56 } 57 58 public function testGlobalObjectWithBackSlashString() 59 { 60 $this->assertEquals((object) ['foo'=> 'back\\slash'], $GLOBALS['globalObjectWithBackSlashString']); 61 } 62 63 public function testGlobalObjectWithDoubleBackSlashString() 64 { 65 $this->assertEquals((object) ['foo'=> 'back\\\\slash'], $GLOBALS['globalObjectWithDoubleBackSlashString']); 66 } 67} 68