コード例 #1
0
ファイル: modRequestTest.php プロジェクト: rossng/revolution
 /**
  * Test the getParameters method, getting various types of request data, and asking for specific keys
  */
 public function testGetParameters()
 {
     $parameters = $this->request->getParameters();
     $this->assertEquals(2, $parameters['testGet']);
     $parameters = $this->request->getParameters(array(), 'POST');
     $this->assertEquals(1, $parameters['testPost']);
     $parameters = $this->request->getParameters(array(), 'COOKIE');
     $this->assertEquals(3, $parameters['testCookie']);
     $parameters = $this->request->getParameters(array(), 'REQUEST');
     $this->assertEquals(4, $parameters['testRequest']);
     $parameters = $this->request->getParameters(array('testRequest'), 'REQUEST');
     $this->assertEquals(4, $parameters['testRequest']);
     $parameters = $this->request->getParameters(array('testShouldNotExist'), 'REQUEST');
     $this->assertEmpty($parameters);
 }