From 60385d1d2837485bae88541a104d5ebbb4b94147 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 19 Sep 2012 03:14:55 +0200 Subject: [PATCH] test the query() method with arrays passed via $_GET --- .../Test/Case/Network/CakeRequestTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index ae33d00b7..981a2c044 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -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 *