From ea7163f02efc9eae46f011cc1ebd126b1309a39e Mon Sep 17 00:00:00 2001 From: Kirk Mayo Date: Fri, 20 Dec 2013 14:23:13 +1300 Subject: [PATCH] BUG: Fixes #179 broken unit tests caused by tests not having classes for ExtendedEditableFormField --- tests/EditableFormFieldTest.php | 10 +-- tests/EditableFormFieldTest.yml | 135 ++++++++++++++++++++++++++++++++ tests/UserDefinedFormTest.yml | 8 -- 3 files changed, 140 insertions(+), 13 deletions(-) create mode 100644 tests/EditableFormFieldTest.yml diff --git a/tests/EditableFormFieldTest.php b/tests/EditableFormFieldTest.php index faedfc7..6ff7004 100644 --- a/tests/EditableFormFieldTest.php +++ b/tests/EditableFormFieldTest.php @@ -6,12 +6,12 @@ class EditableFormFieldTest extends FunctionalTest { - static $fixture_file = 'userforms/tests/UserDefinedFormTest.yml'; + static $fixture_file = 'userforms/tests/EditableFormFieldTest.yml'; - protected $extraDataObjects = array( - 'ExtendedEditableFormField', - 'EditableFormFieldExtension' - ); + protected $extraDataObjects = array( + 'ExtendedEditableFormField', + 'EditableFormFieldExtension' + ); function testFormFieldPermissions() { $text = $this->objFromFixture('EditableTextField', 'basic-text'); diff --git a/tests/EditableFormFieldTest.yml b/tests/EditableFormFieldTest.yml new file mode 100644 index 0000000..5b82e25 --- /dev/null +++ b/tests/EditableFormFieldTest.yml @@ -0,0 +1,135 @@ +EditableOption: + option-1: + Name: Option1 + Title: Option 1 + + option-2: + Name: Option2 + Title: Option 2 + + department-1: + Name: dept1 + Title: sales@example.com + + department-2: + Name: dept2 + Title: accounts@example.com + + option-3: + Name: Option3 + Title: Option 3 + + option-4: + Name: Option4 + Title: Option 4 + + option-5: + Name: Option5 + Title: Option 5 + + option-6: + Name: Option6 + Title: Option 6 + +UserDefinedForm_EmailRecipient: + recipient-1: + EmailAddress: test@example.com + EmailSubject: Email Subject + EmailFrom: no-reply@example.com + + no-html: + EmailAddress: nohtml@example.com + EmailSubject: Email Subject + EmailFrom: no-reply@example.com + SendPlain: true + + no-data: + EmailAddress: nodata@example.com + EmailSubject: Email Subject + EmailFrom: no-reply@example.com + HideFormData: true + +EditableTextField: + basic-text: + Name: basic-text-name + Title: Basic Text Field + + basic-text-2: + Name: basic-text-name + Title: Basic Text Field + + required-text: + Name: required-text-field + Title: Required Text Field + CustomErrorMessage: Custom Error Message + Required: true + +EditableDropdown: + basic-dropdown: + Name: basic-dropdown + Title: Basic Dropdown Field + Options: =>EditableOption.option-1, =>EditableOption.option-2 + + department-dropdown: + Name: department + Title: Department + Options: =>EditableOption.department-1, =>EditableOption.department-2 + +EditableCheckbox: + checkbox-1: + Name: checkbox-1 + Title: Checkbox 1 + + checkbox-2: + Name: checkbox-1 + Title: Checkbox 1 + +EditableCheckboxGroupField: + checkbox-group: + Name: check-box-group + Title: Check box group + Options: =>EditableOption.option-3, =>EditableOption.option-4 + +EditableEmailField: + email-field: + Name: email-field + Title: Email + + +EditableRadioField: + radio-field: + Name: radio-option + Title: Radio Option + Options: =>EditableOption.option-5, =>EditableOption.option-6 + + +ExtendedEditableFormField: + extended-field: + Name: extended-field + Title: Extended Field + TestExtraField: Extra Field + TestValidationField: Extra Validation Field + + +UserDefinedForm: + basic-form-page: + Title: User Defined Form + Fields: =>EditableTextField.basic-text + EmailRecipients: =>UserDefinedForm_EmailRecipient.recipient-1, =>UserDefinedForm_EmailRecipient.no-html, =>UserDefinedForm_EmailRecipient.no-data + + form-with-reset-and-custom-action: + Title: Form with Reset Action + SubmitButtonText: Custom Button + ShowClearButton: true + + validation-form: + Title: Validation Form + Fields: =>EditableTextField.required-text + + custom-rules-form: + Title: Custom Rules Form + Fields: =>EditableCheckbox.checkbox-2, =>EditableTextField.basic-text-2 + empty-form: + Title: Empty Form + + diff --git a/tests/UserDefinedFormTest.yml b/tests/UserDefinedFormTest.yml index 5b82e25..7b95324 100644 --- a/tests/UserDefinedFormTest.yml +++ b/tests/UserDefinedFormTest.yml @@ -103,14 +103,6 @@ EditableRadioField: Options: =>EditableOption.option-5, =>EditableOption.option-6 -ExtendedEditableFormField: - extended-field: - Name: extended-field - Title: Extended Field - TestExtraField: Extra Field - TestValidationField: Extra Validation Field - - UserDefinedForm: basic-form-page: Title: User Defined Form