Changeset 11849
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r11817 r11849 159 159 'textarea' => 'BP_XProfile_Field_Type_Textarea', 160 160 'textbox' => 'BP_XProfile_Field_Type_Textbox', 161 'telephone' => 'BP_XProfile_Field_Type_Telephone', 161 162 ); 162 163 … … 869 870 */ 870 871 function xprofile_sync_wp_profile_on_single_field_set( $data ) { 871 872 872 873 if ( bp_xprofile_fullname_field_id() !== $data->field_id ) { 873 874 return; -
trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-field-type.php
r10592 r11849 76 76 public function test_number_do_not_validate_string() { 77 77 $field = bp_xprofile_create_field_type( 'number' ); 78 $this->assertFalse( $field->is_valid( ' telephonefields only accept integers' ) );78 $this->assertFalse( $field->is_valid( 'number fields only accept integers' ) ); 79 79 $this->assertFalse( $field->is_valid( '' ) ); 80 80 } … … 177 177 $this->assertTrue( $field->is_valid( array( 'bar' ) ) ); 178 178 } 179 180 public function test_telephone_validate_number_formats() { 181 $field = bp_xprofile_create_field_type( 'telephone' ); 182 $this->assertTrue( $field->is_valid( '07700 900461' ) ); 183 $this->assertTrue( $field->is_valid( '555-2368' ) ); 184 $this->assertTrue( $field->is_valid( '(212) 664-7665' ) ); 185 } 179 186 }
Note: See TracChangeset
for help on using the changeset viewer.