Skip to content
Permalink
Browse files

Removing reference operators that caused tests to fail.

Adding an alias as several tests relied on a User object being in the registry to autodetect fields.
  • Loading branch information...
markstory committed Aug 5, 2010
1 parent 3d5d6f6 commit 2494156e9a78420e53956f2e8bc222f6c98e4877
Showing with 10 additions and 17 deletions.
  1. +1 −1 cake/libs/view/helpers/form.php
  2. +9 −16 cake/tests/cases/libs/view/helpers/form.test.php
@@ -105,7 +105,7 @@ protected function &_introspectModel($model) {
}
if (ClassRegistry::isKeySet($model)) {
$object =& ClassRegistry::getObject($model);
$object = ClassRegistry::getObject($model);
}
if (!empty($object)) {
@@ -681,7 +681,7 @@ function setUp() {
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 @@ function setUp() {
* @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 @@ function testPasswordValidation() {
* @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 @@ function testFormValidationAssociated() {
* @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 @@ function testFormValidationAssociatedFirstLevel() {
* @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'),

0 comments on commit 2494156

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