Skip to content
Permalink
Browse files

Moving query string params around. Updating test cases.

  • Loading branch information...
markstory committed Apr 30, 2010
1 parent 0bbd7fa commit 51db3c80efaf45bec91300618ab5c5488e3f93bc
Showing with 24 additions and 5 deletions.
  1. +13 −4 cake/libs/cake_request.php
  2. +11 −1 cake/tests/cases/libs/cake_request.test.php
@@ -42,7 +42,14 @@ class CakeRequest implements ArrayAccess {
*
* @var array
*/
public $url = array();
public $query = array();
/**
* The url string used for the request.
*
* @var string
*/
public $url;
/**
* The built in detectors used with `is()` can be modified with `addDetector()`.
@@ -122,9 +129,11 @@ protected function _processGet() {
$url = $_GET;
}
if (isset($this->params['url'])) {
$this->url = array_merge($this->url, $url);
} else {
$this->url = $url;
$url = array_merge($this->params['url'], $url);
}
$this->query = $url;
if (isset($this->query['url'])) {
$this->url = $this->query['url'];
}
}
@@ -38,7 +38,17 @@ function testConstructionGetParsing() {
'two' => 'banana'
);
$request = new CakeRequest();
$this->assertEqual($request->url, $_GET);
$this->assertEqual($request->query, $_GET);
$_GET = array(
'one' => 'param',
'two' => 'banana',
'url' => '/some/path/here'
);
$request = new CakeRequest();
$this->assertEqual($request->query, $_GET);
$this->assertEqual($request->url, $_GET['url']);
}
/**

0 comments on commit 51db3c8

Please sign in to comment.
You can’t perform that action at this time.