diff --git bp-xprofile/bp-xprofile-classes.php bp-xprofile/bp-xprofile-classes.php
index 63e4266..522bb45 100644
|
|
class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type { |
2519 | 2519 | * @since BuddyPress (2.0.1) |
2520 | 2520 | */ |
2521 | 2521 | public function __construct() { |
| 2522 | $this->set_format( '/.*/', 'replace' ); |
2522 | 2523 | } |
2523 | 2524 | |
2524 | 2525 | /** |
diff --git tests/testcases/xprofile/class-bp-xprofile-field-type.php tests/testcases/xprofile/class-bp-xprofile-field-type.php
index 04ace3c..619040e 100644
|
|
class BP_Tests_XProfile_Field_Type extends BP_UnitTestCase { |
153 | 153 | $this->assertFalse( $field->is_valid( '' ) ); |
154 | 154 | $this->assertTrue( $field->is_valid( array() ) ); |
155 | 155 | } |
| 156 | |
| 157 | /** |
| 158 | * @group BP_XProfile_Field_Group_Type_Placeholder |
| 159 | */ |
| 160 | public function test_placeholder_validate_any_value() { |
| 161 | $field = bp_xprofile_create_field_type( 'foo' ); |
| 162 | $this->assertTrue( $field->is_valid( '' ) ); |
| 163 | $this->assertTrue( $field->is_valid( 'bar' ) ); |
| 164 | $this->assertTrue( $field->is_valid( array( 'bar' ) ) ); |
| 165 | } |
156 | 166 | } |