Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/28/2015 03:28:05 PM (10 years ago)
Author:
boonebgorges
Message:

Avoid PHP notices when calling groups_delete_groupmeta() on group with no metadata.

Fixes #6326.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/functions.php

    r9562 r9654  
    519519     * @group groupmeta
    520520     * @group groups_delete_groupmeta
     521     * @ticket BP6326
     522     */
     523    public function test_groups_delete_groupmeta_with_no_meta_key_when_group_has_metadata() {
     524        global $wpdb;
     525
     526        $g = $this->factory->group->create();
     527        $m = groups_get_groupmeta( $g );
     528        foreach ( $m as $mk => $mv ) {
     529            groups_delete_groupmeta( $g, $mk );
     530        }
     531
     532        $found = groups_delete_groupmeta( $g );
     533        $this->assertTrue( $found );
     534    }
     535
     536    /**
     537     * @group groupmeta
     538     * @group groups_delete_groupmeta
    521539     */
    522540    public function test_groups_delete_groupmeta_with_delete_all_but_no_meta_key() {
Note: See TracChangeset for help on using the changeset viewer.