diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 503c2e50a..dd5d72a87 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -105,7 +105,7 @@ class FormHelper extends AppHelper { } if (ClassRegistry::isKeySet($model)) { - $object =& ClassRegistry::getObject($model); + $object = ClassRegistry::getObject($model); } if (!empty($object)) { diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index b719d4129..9355da680 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -681,7 +681,7 @@ class FormHelperTest extends CakeTestCase { ClassRegistry::addObject('Contact', new Contact()); ClassRegistry::addObject('ContactNonStandardPk', new ContactNonStandardPk()); ClassRegistry::addObject('OpenidUrl', new OpenidUrl()); - ClassRegistry::addObject('UserForm', new UserForm()); + ClassRegistry::addObject('User', new UserForm()); ClassRegistry::addObject('ValidateItem', new ValidateItem()); ClassRegistry::addObject('ValidateUser', new ValidateUser()); ClassRegistry::addObject('ValidateProfile', new ValidateProfile()); @@ -707,14 +707,7 @@ class FormHelperTest extends CakeTestCase { * @return void */ function tearDown() { - ClassRegistry::removeObject('Contact'); - ClassRegistry::removeObject('ContactNonStandardPk'); - ClassRegistry::removeObject('ContactTag'); - ClassRegistry::removeObject('OpenidUrl'); - ClassRegistry::removeObject('UserForm'); - ClassRegistry::removeObject('ValidateItem'); - ClassRegistry::removeObject('ValidateUser'); - ClassRegistry::removeObject('ValidateProfile'); + ClassRegistry::flush(); unset($this->Form->Html, $this->Form, $this->Controller, $this->View); Configure::write('Security.salt', $this->oldSalt); } @@ -1308,8 +1301,8 @@ class FormHelperTest extends CakeTestCase { * @return void */ function testFormValidationAssociated() { - $this->UserForm =& ClassRegistry::getObject('UserForm'); - $this->UserForm->OpenidUrl =& ClassRegistry::getObject('OpenidUrl'); + $this->UserForm = ClassRegistry::getObject('UserForm'); + $this->UserForm->OpenidUrl = ClassRegistry::getObject('OpenidUrl'); $data = array( 'UserForm' => array('name' => 'user'), @@ -1353,8 +1346,8 @@ class FormHelperTest extends CakeTestCase { * @return void */ function testFormValidationAssociatedFirstLevel() { - $this->ValidateUser =& ClassRegistry::getObject('ValidateUser'); - $this->ValidateUser->ValidateProfile =& ClassRegistry::getObject('ValidateProfile'); + $this->ValidateUser = ClassRegistry::getObject('ValidateUser'); + $this->ValidateUser->ValidateProfile = ClassRegistry::getObject('ValidateProfile'); $data = array( 'ValidateUser' => array('name' => 'mariano'), @@ -1395,9 +1388,9 @@ class FormHelperTest extends CakeTestCase { * @return void */ function testFormValidationAssociatedSecondLevel() { - $this->ValidateUser =& ClassRegistry::getObject('ValidateUser'); - $this->ValidateUser->ValidateProfile =& ClassRegistry::getObject('ValidateProfile'); - $this->ValidateUser->ValidateProfile->ValidateItem =& ClassRegistry::getObject('ValidateItem'); + $this->ValidateUser = ClassRegistry::getObject('ValidateUser'); + $this->ValidateUser->ValidateProfile = ClassRegistry::getObject('ValidateProfile'); + $this->ValidateUser->ValidateProfile->ValidateItem = ClassRegistry::getObject('ValidateItem'); $data = array( 'ValidateUser' => array('name' => 'mariano'),