Skip to content
Permalink
Browse files

Fixing FormHelperTest for phpunit

  • Loading branch information...
lorenzo committed May 18, 2010
1 parent 32a46e9 commit f7949d6aceb6dea59e60a63497e671be8de95c37
Showing with 12 additions and 9 deletions.
  1. +12 −9 cake/tests/cases/libs/view/helpers/form.test.php
@@ -1306,7 +1306,8 @@ function testFormValidationAssociated() {
'OpenidUrl' => array('url' => 'http://www.cakephp.org')
);
$this->assertTrue($this->UserForm->OpenidUrl->create($data));
$result = $this->UserForm->OpenidUrl->create($data);
$this->assertFalse(empty($result));
$this->assertFalse($this->UserForm->OpenidUrl->validates());
$result = $this->Form->create('UserForm', array('type' => 'post', 'action' => 'login'));
@@ -1322,7 +1323,7 @@ function testFormValidationAssociated() {
);
$this->assertTags($result, $expected);
$expected = array('OpenidUrl' => array('openid_not_registered' => 1));
$expected = array('OpenidUrl' => array('openid_not_registered' => true));
$this->assertEqual($this->Form->validationErrors, $expected);
$result = $this->Form->error(
@@ -1350,7 +1351,8 @@ function testFormValidationAssociatedFirstLevel() {
'ValidateProfile' => array('full_name' => 'Mariano Iglesias')
);
$this->assertTrue($this->ValidateUser->create($data));
$result = $this->ValidateUser->create($data);
$this->assertFalse(empty($result));
$this->assertFalse($this->ValidateUser->validates());
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
@@ -1365,8 +1367,8 @@ function testFormValidationAssociatedFirstLevel() {
$this->assertTags($result, $expected);
$expected = array(
'ValidateUser' => array('email' => 1),
'ValidateProfile' => array('full_name' => 1, 'city' => 1)
'ValidateUser' => array('email' => true),
'ValidateProfile' => array('full_name' => true, 'city' => true)
);
$this->assertEqual($this->Form->validationErrors, $expected);
@@ -1393,7 +1395,8 @@ function testFormValidationAssociatedSecondLevel() {
'ValidateItem' => array('name' => 'Item')
);
$this->assertTrue($this->ValidateUser->create($data));
$result = $this->ValidateUser->create($data);
$this->assertFalse(empty($result));
$this->assertFalse($this->ValidateUser->validates());
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
$this->assertFalse($this->ValidateUser->ValidateProfile->ValidateItem->validates());
@@ -1409,9 +1412,9 @@ function testFormValidationAssociatedSecondLevel() {
$this->assertTags($result, $expected);
$expected = array(
'ValidateUser' => array('email' => 1),
'ValidateProfile' => array('full_name' => 1, 'city' => 1),
'ValidateItem' => array('description' => 1)
'ValidateUser' => array('email' => true),
'ValidateProfile' => array('full_name' => true, 'city' => true),
'ValidateItem' => array('description' => true)
);
$this->assertEqual($this->Form->validationErrors, $expected);

0 comments on commit f7949d6

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