mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
test the query() method with arrays passed via $_GET
This commit is contained in:
parent
e8cfac0eec
commit
60385d1d28
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue