Skip to:
Content

BuddyPress.org

Changeset 8347


Ignore:
Timestamp:
05/03/2014 12:18:40 AM (11 years ago)
Author:
boonebgorges
Message:

Ensure that the BP_XProfile_Field_Type_Placeholder class has a validation regex

This ensures that any value will pass the is_valid() test for this field type.

Fixes #5589

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r8338 r8347  
    25202520     */
    25212521    public function __construct() {
     2522        $this->set_format( '/.*/', 'replace' );
    25222523    }
    25232524
  • trunk/tests/testcases/xprofile/class-bp-xprofile-field-type.php

    r8336 r8347  
    154154        $this->assertTrue( $field->is_valid( array() ) );
    155155    }
     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    }
    156166}
Note: See TracChangeset for help on using the changeset viewer.