示例#1
0
 public function testGlobalVarAssign()
 {
     $t = new \Test\Assign();
     /**
      * @see LetStatement::_assignArrayIndexSingle();
      */
     assert(!isset($_POST['test_index']));
     $t->testGlobalVarAssign('test_index', 'value');
     assert($_POST['test_index'] == 'value');
 }
示例#2
0
 public function testGlobalVarAssign()
 {
     $t = new \Test\Assign();
     /**
      * @see LetStatement::_assignArrayIndexSingle();
      */
     assert(!isset($_POST['test_index']));
     $t->testGlobalVarAssign('test_index', 'value');
     assert($_POST['test_index'] == 'value');
     /* Check primitive types */
     $t->testAssignSuperGlobals();
     assert($_GET["steststr"] == "stest");
     assert($_GET["steststr2"] == "stest2");
     assert($_GET["stestint"] == 1);
     assert($_GET["stestint2"] == 2);
     assert($_GET["stest2"] == "testval");
 }
示例#3
0
 public function testGlobalVarAssign()
 {
     $t = new \Test\Assign();
     /**
      * @see LetStatement::_assignArrayIndexSingle();
      */
     $this->assertTrue(!isset($_POST['test_index']));
     $t->testGlobalVarAssign('test_index', 'value');
     $this->assertSame($_POST['test_index'], 'value');
     /* Check primitive types */
     $t->testAssignSuperGlobals();
     $this->assertSame($_GET['steststr'], 'stest');
     $this->assertSame($_GET['steststr2'], 'stest2');
     $this->assertSame($_GET['stestint'], 1);
     $this->assertSame($_GET['stestint2'], 2);
     $this->assertSame($_GET['stest2'], 'testval');
 }