From f7949d6aceb6dea59e60a63497e671be8de95c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 17 May 2010 22:30:04 -0430 Subject: [PATCH] Fixing FormHelperTest for phpunit --- .../cases/libs/view/helpers/form.test.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 5428ab53d..4223ec303 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1306,7 +1306,8 @@ class FormHelperTest extends CakeTestCase { '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 @@ class FormHelperTest extends CakeTestCase { ); $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 @@ class FormHelperTest extends CakeTestCase { '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 @@ class FormHelperTest extends CakeTestCase { $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 @@ class FormHelperTest extends CakeTestCase { '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 @@ class FormHelperTest extends CakeTestCase { $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);