Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Mark Story 2010-10-31 21:58:38 -04:00
commit c2063f1229
2 changed files with 23 additions and 0 deletions

View file

@ -327,6 +327,24 @@ class Controller extends Object {
parent::__construct();
}
/**
* Provides backwards compatbility avoid problems with empty and isset to alias properties.
*
* @return void
*/
public function __isset($name) {
switch ($name) {
case 'base':
case 'here':
case 'webroot':
case 'data':
case 'action':
case 'params':
return true;
}
return false;
}
/**
* Provides backwards compatbility access to the request object properties.
* Also provides the params alias.

View file

@ -1581,6 +1581,11 @@ class ControllerTest extends CakeTestCase {
$this->assertEquals($request->here, $Controller->here);
$this->assertEquals($request->action, $Controller->action);
$this->assertFalse(empty($Controller->data));
$this->assertTrue(isset($Controller->data));
$this->assertTrue(empty($Controller->something));
$this->assertFalse(isset($Controller->something));
$this->assertEquals($request, $Controller->params);
$this->assertEquals($request->params['controller'], $Controller->params['controller']);
}