Fixing issue where 'data' could not be accessed with array access, there were tests in Dispatchers tests that expected this.

This commit is contained in:
Mark Story 2010-05-01 23:46:10 -04:00
parent d2ea077b81
commit e4cf8a6937
2 changed files with 7 additions and 1 deletions

View file

@ -92,7 +92,7 @@ class CakeRequest implements ArrayAccess {
'mobile' => array('env' => 'HTTP_USER_AGENT', 'options' => array( 'mobile' => array('env' => 'HTTP_USER_AGENT', 'options' => array(
'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'iPod', 'iPhone', 'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'iPod', 'iPhone',
'J2ME', 'MIDP', 'NetFront', 'Nokia', 'Opera Mini', 'PalmOS', 'PalmSource', 'J2ME', 'MIDP', 'NetFront', 'Nokia', 'Opera Mini', 'PalmOS', 'PalmSource',
'portalmmm', 'Plucker', 'ReqwirelessWeb', 'SonyEricsson', 'Symbian', 'UP\.Browser', 'portalmmm', 'Plucker', 'ReqwirelessWeb', 'SonyEricsson', 'Symbian', 'UP\\.Browser',
'webOS', 'Windows CE', 'Xiino' 'webOS', 'Windows CE', 'Xiino'
)) ))
); );
@ -522,6 +522,9 @@ class CakeRequest implements ArrayAccess {
if ($name == 'url') { if ($name == 'url') {
return $this->query; return $this->query;
} }
if ($name == 'data') {
return $this->data;
}
return null; return null;
} }

View file

@ -560,6 +560,9 @@ class CakeRequestTestCase extends CakeTestCase {
$request = new CakeRequest('some/path?one=something&two=else'); $request = new CakeRequest('some/path?one=something&two=else');
$this->assertTrue(isset($request['url']['one'])); $this->assertTrue(isset($request['url']['one']));
$request->data = array('Post' => array('title' => 'something'));
$this->assertEqual($request['data']['Post']['title'], 'something');
} }
/** /**