Beispiel #1
0
 function testGet()
 {
     $request = new TestRequest();
     $input = array('string' => 'A string', 'array' => array(1, 2, 3), 'test' => 'bar');
     $response = $request->get($input, '/doku.php?id=wiki:dokuwiki&test=foo');
     // server var check
     $this->assertEquals('GET', $request->getServer('REQUEST_METHOD'));
     $this->assertEquals('?id=wiki:dokuwiki&test=bar&string=A+string&array[0]=1&array[1]=2&array[2]=3', $request->getServer('QUERY_STRING'));
     $this->assertEquals('/doku.php?id=wiki:dokuwiki&test=bar&string=A+string&array[0]=1&array[1]=2&array[2]=3', $request->getServer('REQUEST_URI'));
     // variable setup check
     $this->assertEquals('A string', $request->getGet('string'));
     $this->assertEquals(array(1, 2, 3), $request->getGet('array'));
     $this->assertEquals('wiki:dokuwiki', $request->getGet('id'));
     $this->assertEquals('bar', $request->getGet('test'));
     // output check
     $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') >= 0);
 }