From 5eaa76afe0ab1beca72c361a004e420d4c5149ee Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Fri, 6 Apr 2007 18:35:25 +0000 Subject: [PATCH] Improved test for #2360 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4806 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/helpers/form.test.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 8c1c7baec..707a501ff 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -77,7 +77,10 @@ var $primaryKey = 'id'; var $name = 'UserForm'; - var $hasMany = array('OpenidUrl'); + var $hasMany = array('OpenidUrl' => array( + 'className' => 'OpenidUrl', + 'foreignKey' => 'user_form_id' + )); function loadInfo() { return new Set(array( @@ -100,12 +103,15 @@ var $primaryKey = 'id'; var $name = 'OpenidUrl'; - var $belongsTo = array('UserForm'); + var $belongsTo = array('UserForm' => array( + 'className' => 'UserForm', + 'foreignKey' => 'user_form_id' + )); function loadInfo() { return new Set(array( array('name' => 'id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), - array('name' => 'user_id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), + array('name' => 'user_form_id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), array('name' => 'url', 'type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), )); } @@ -134,10 +140,7 @@ class FormHelperTest extends UnitTestCase { function testFormValidationAssociated() { $this->UserForm = new UserForm(); - ClassRegistry::addObject('UserForm', $this->UserForm); - $this->UserForm->OpenidUrl = new OpenidUrl(); - ClassRegistry::addObject('OpenidUrl', $this->UserForm->OpenidUrl); $data = array( 'UserForm' => array(