Skip to content

Commit

Permalink
Fixing remaining failing tests on FormHelperTest case
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 14, 2011
1 parent a5851e9 commit 0228611
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -7138,7 +7138,8 @@ public function testMultiRecordForm() {
);
$this->assertTags($result, $expected);

$this->Form->validationErrors['ValidateProfile'][1]['ValidateItem'][2]['profile_id'] = 'Error';
$ValidateProfile = ClassRegistry::getObject('ValidateProfile');
$ValidateProfile->validationErrors[1]['ValidateItem'][2]['profile_id'] = 'Error';
$this->Form->request->data['ValidateProfile'][1]['ValidateItem'][2]['profile_id'] = '1';
$result = $this->Form->input('ValidateProfile.1.ValidateItem.2.profile_id');
$expected = array(
Expand Down Expand Up @@ -7167,11 +7168,12 @@ public function testMultiRecordForm() {
*/
public function testMultiRecordFormValidationErrors() {
$this->Form->create('ValidateProfile');
$this->Form->validationErrors['ValidateProfile'][2]['ValidateItem'][1]['name'] = array('Error in field name');
$ValidateProfile = ClassRegistry::getObject('ValidateProfile');
$ValidateProfile->validationErrors[2]['ValidateItem'][1]['name'] = array('Error in field name');
$result = $this->Form->error('ValidateProfile.2.ValidateItem.1.name');
$this->assertTags($result, array('div' => array('class' => 'error-message'), 'Error in field name', '/div'));

$this->Form->validationErrors['ValidateProfile'][2]['city'] = array('Error in field city');
$ValidateProfile->validationErrors[2]['city'] = array('Error in field city');
$result = $this->Form->error('ValidateProfile.2.city');
$this->assertTags($result, array('div' => array('class' => 'error-message'), 'Error in field city', '/div'));

Expand Down

0 comments on commit 0228611

Please sign in to comment.