From bd929c45dfc11d53cb54c701d0b2201ee9d3f944 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 10 Mar 2008 03:54:15 +0000 Subject: [PATCH] Adding test case for validation error display with FormHelper::input(type => password), disproves #4242 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6548 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/helpers/form.test.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 7f6647631..13c720cc5 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -305,6 +305,12 @@ class FormHelperTest extends CakeTestCase { $this->assertEqual($result, $fields); } + function testPasswordValidation() { + $this->Form->validationErrors['Contact']['password'] = 'Please provide a password'; + $result = $this->Form->input('Contact.password'); + $this->assertPattern('/]*class="error-message"[^<>]*>Please provide a password<\/div>/', $result); + } + function testFormValidationAssociated() { $this->UserForm =& ClassRegistry::getObject('UserForm'); $this->UserForm->OpenidUrl =& ClassRegistry::getObject('OpenidUrl');