Permalink
Browse files

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

  • Loading branch information...
1 parent e8cfac0 commit 60385d1d2837485bae88541a104d5ebbb4b94147 @dereuromark dereuromark committed Sep 19, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -1697,6 +1697,27 @@ public function testQuery() {
}
/**
+ * 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
*
* @return void

0 comments on commit 60385d1

Please sign in to comment.