From 792ba68b35cdbededbfce96730f2b647f3685017 Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Thu, 4 Oct 2007 18:16:44 +0000 Subject: [PATCH] Restoring commented test functions git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5719 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../cases/libs/view/helpers/form.test.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index bb3a86568..065fdd56c 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -220,7 +220,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/]+[^type|name|value|id]=[^<>]*>/', $result); } - function _testFormValidationAssociated() { + function testFormValidationAssociated() { $this->UserForm =& ClassRegistry::getObject('UserForm'); $this->UserForm->OpenidUrl =& ClassRegistry::getObject('OpenidUrl'); @@ -245,7 +245,7 @@ class FormHelperTest extends CakeTestCase { unset($this->UserForm); } - function _testFormValidationAssociatedFirstLevel() { + function testFormValidationAssociatedFirstLevel() { $this->ValidateUser =& ClassRegistry::getObject('ValidateUser'); $this->ValidateUser->ValidateProfile =& ClassRegistry::getObject('ValidateProfile'); @@ -269,7 +269,7 @@ class FormHelperTest extends CakeTestCase { unset($this->ValidateUser); } - function _testFormValidationAssociatedSecondLevel() { + function testFormValidationAssociatedSecondLevel() { $this->ValidateUser =& ClassRegistry::getObject('ValidateUser'); $this->ValidateUser->ValidateProfile =& ClassRegistry::getObject('ValidateProfile'); $this->ValidateUser->ValidateProfile->ValidateItem =& ClassRegistry::getObject('ValidateItem'); @@ -300,7 +300,7 @@ class FormHelperTest extends CakeTestCase { unset($this->ValidateUser); } - function _testFormInput() { + function testFormInput() { $result = $this->Form->input('Model.field', array('type' => 'text')); $expected = '
'; $this->assertEqual($result, $expected); @@ -362,7 +362,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/error-message/', $result); } - function _testLabel() { + function testLabel() { $this->Form->text('Person/name'); $result = $this->Form->label(); $this->assertEqual($result, ''); @@ -391,7 +391,7 @@ class FormHelperTest extends CakeTestCase { $this->assertEqual($result, ''); } - function _testTextbox() { + function testTextbox() { $result = $this->Form->text('Model.field'); $this->assertPattern('/^]+name="data\[Model\]\[field\]"[^<>]+\/>$/', $result); $this->assertPattern('/^]+type="text"[^<>]+\/>$/', $result); @@ -421,7 +421,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/]+[^type|name|id|value|class]=[^<>]*>/', $result); } - function _testDefaultValue() { + function testDefaultValue() { $this->Form->data['Model']['field'] = 'test'; $result = $this->Form->text('Model.field', array('default' => 'default value')); $this->assertPattern('/^]+value="test"[^<>]+\/>$/', $result); @@ -431,7 +431,7 @@ class FormHelperTest extends CakeTestCase { $this->assertPattern('/^]+value="default value"[^<>]+\/>$/', $result); } - function _testFieldError() { + function testFieldError() { $this->Form->validationErrors['Model']['field'] = 1; $result = $this->Form->error('Model.field'); $this->assertEqual($result, '
Error in field Field
'); @@ -453,7 +453,7 @@ class FormHelperTest extends CakeTestCase { $this->assertEqual($result, 'Badness!'); } - function _testPassword() { + function testPassword() { $result = $this->Form->password('Model.field'); $expected = ''; $this->assertPattern('/^]+name="data\[Model\]\[field\]"[^<>]+\/>$/', $result); @@ -472,7 +472,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/]+[^type|name|id|value|class]=[^<>]*>/', $result); } - function _testRadio() { + function testRadio() { $result = $this->Form->radio('Model.field', array('option A', 'option B')); $this->assertPattern('/id="Field0"/', $result); $this->assertPattern('/id="Field1"/', $result); @@ -488,7 +488,7 @@ class FormHelperTest extends CakeTestCase { $this->assertPattern('/id="Field0".*checked="checked"/', $result); } - function _testSelect() { + function testSelect() { $result = $this->Form->select('Model.field', array()); $this->assertPattern('/^'); } - function _testMonth() { + function testMonth() { $result = $this->Form->month('Model.field'); $this->assertPattern('/' . ']*>January<\/option>\s+'. @@ -637,7 +637,7 @@ class FormHelperTest extends CakeTestCase { '/i', $result); } - function _testDay() { + function testDay() { $result = $this->Form->day('Model.field', false); $this->assertPattern('/option value="12"/', $result); $this->assertPattern('/option value="13"/', $result); @@ -660,7 +660,7 @@ class FormHelperTest extends CakeTestCase { } - function _testHour() { + function testHour() { $result = $this->Form->hour('Model.field', false); $this->assertPattern('/option value="12"/', $result); $this->assertNoPattern('/option value="13"/', $result); @@ -682,7 +682,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/option value="24"/', $result); } - function _testYear() { + function testYear() { $result = $this->Form->year('Model.field', 2006, 2007); $this->assertPattern('/option value="2006"/', $result); @@ -732,7 +732,7 @@ class FormHelperTest extends CakeTestCase { } - function _testTextArea() { + function testTextArea() { $this->Form->data = array('Model' => array('field' => 'some test data')); $result = $this->Form->textarea('Model.field'); $this->assertPattern('/^]+name="data\[Model\]\[field\]"[^<>]+id="ModelField"/', $result); @@ -745,7 +745,7 @@ class FormHelperTest extends CakeTestCase { $this->assertPattern('/^]+name="data\[Model\]\[tmp\]"[^<>]+><\/textarea>/', $result); } - function _testHiddenField() { + function testHiddenField() { $this->Form->validationErrors['Model']['field'] = 1; $this->Form->data['Model']['field'] = 'test'; $result = $this->Form->hidden('Model.field', array('id' => 'theID')); @@ -755,7 +755,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/]+[^type|name|id|value|class]=[^<>]*>/', $result); } - function _testFileUploadField() { + function testFileUploadField() { $result = $this->Form->file('Model.upload'); $this->assertPattern('/^]+name="data\[Model\]\[upload\]"[^<>]+\/>$/', $result); $this->assertPattern('/^]+value=""[^<>]+\/>$/', $result); @@ -764,7 +764,7 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/]+[^type|name|value|id]=[^<>]*>$/', $result); } - function _testSubmitButton() { + function testSubmitButton() { $result = $this->Form->submit('Test Submit'); $this->assertPattern('/^]+value="Test Submit"[^<>]+\/><\/div>$/', $result); @@ -784,7 +784,7 @@ class FormHelperTest extends CakeTestCase { $this->assertPattern('/^]+value="Next >"[^<>]+\/><\/div>$/', $result); } - function _testFormCreate() { + function testFormCreate() { $result = $this->Form->create('Contact'); $this->assertPattern('/^
]+>/', $result); $this->assertPattern('/\s+id="ContactAddForm"/', $result); @@ -818,7 +818,7 @@ class FormHelperTest extends CakeTestCase { $this->assertPattern('/action="\/users\/login[\/]"/', $result); } - function _testFormMagicInput() { + function testFormMagicInput() { $result = $this->Form->create('Contact'); $this->assertPattern('/^$/', $result); $this->assertNoPattern('/^]+[^id|method|action]=[^<>]*>/', $result); @@ -872,7 +872,7 @@ class FormHelperTest extends CakeTestCase { '$/', $result); } - function _testSetFormTag() { + function testSetFormTag() { $controller = null; new View($controller); $this->Form->setFormTag('Model.field'); } - function _testFormEnd() { + function testFormEnd() { $this->assertEqual($this->Form->end(), ''); $result = $this->Form->end('save');