Changeset 9878
- Timestamp:
- 05/19/2015 04:52:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-field.php
r9819 r9878 55 55 unset( $_POST['checkbox_option'] ); 56 56 } 57 58 /** 59 * @group xprofile_field_admin_validate 60 */ 61 public function test_admin_validate_zero_field_name() { 62 63 // Mock POST global values 64 $_POST['title'] = '0'; 65 $_POST['required'] = false; 66 $_POST['fieldtype'] = 'textbox'; 67 68 // Validate the mocked POST radio button options 69 $result = BP_XProfile_Field::admin_validate(); 70 71 // Assert valid 72 $this->assertEquals( $result, true ); 73 74 // cleanup 75 unset( 76 $_POST['title'], 77 $_POST['required'], 78 $_POST['fieldtype'] 79 ); 80 } 81 82 /** 83 * @group xprofile_field_admin_validate 84 */ 85 public function test_admin_validate_field_options() { 86 87 // Mock POST global values 88 $_POST['title'] = 'Foo'; 89 $_POST['required'] = false; 90 $_POST['fieldtype'] = 'radio'; 91 $_POST['radio_option'] = array( 92 1 => '0', 93 2 => '1', 94 3 => '4', 95 ); 96 97 // Validate the mocked POST radio button options 98 $result = BP_XProfile_Field::admin_validate(); 99 100 // Assert valid 101 $this->assertEquals( $result, true ); 102 103 // cleanup 104 unset( 105 $_POST['title'], 106 $_POST['required'], 107 $_POST['fieldtype'], 108 $_POST['radio_option' ] 109 ); 110 } 57 111 }
Note: See TracChangeset
for help on using the changeset viewer.