Skip to:
Content

BuddyPress.org

Changeset 8346


Ignore:
Timestamp:
05/03/2014 12:17:57 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:
branches/2.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bp-xprofile/bp-xprofile-classes.php

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

    r8337 r8346  
    160160        $this->assertTrue( $field->is_valid( array() ) );
    161161    }
     162
     163    /**
     164     * @group BP_XProfile_Field_Group_Type_Placeholder
     165     */
     166    public function test_placeholder_validate_any_value() {
     167        $field = bp_xprofile_create_field_type( 'foo' );
     168        $this->assertTrue( $field->is_valid( '' ) );
     169        $this->assertTrue( $field->is_valid( 'bar' ) );
     170        $this->assertTrue( $field->is_valid( array( 'bar' ) ) );
     171    }
    162172}
Note: See TracChangeset for help on using the changeset viewer.