Skip to content

Commit

Permalink
test the query() method with arrays passed via $_GET
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Sep 19, 2012
1 parent e8cfac0 commit 60385d1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -1696,6 +1696,27 @@ public function testQuery() {
$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
*
Expand Down

0 comments on commit 60385d1

Please sign in to comment.