test the query() method with arrays passed via $_GET

This commit is contained in:
euromark 2012-09-19 03:14:55 +02:00
parent e8cfac0eec
commit 60385d1d28

View file

@ -1696,6 +1696,27 @@ class CakeRequestTest extends CakeTestCase {
$this->assertNull($result);
}
/**
* test the query() method with arrays passed via $_GET
*
* @return void
*/
public function testQueryWithArray() {
$_GET = array();
$_GET['test'] = array('foo', 'bar');
$request = new CakeRequest();
$result = $request->query('test');
$this->assertEquals(array('foo', 'bar'), $result);
$result = $request->query('test.1');
$this->assertEquals('bar', $result);
$result = $request->query('test.2');
$this->assertNull($result);
}
/**
* test the data() method reading
*