Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 01:59:32 PM (11 years ago)
Author:
boonebgorges
Message:

Add support for $single param in _get_meta() functions

Unlike get_metadata(), we are defaulting to $single = true, for backward
compatibility.

See #5400

File:
1 edited

Legend:

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

    r7875 r7879  
    395395    /**
    396396     * @group groupmeta
     397     * @group groups_get_groupmeta
     398     */
     399    public function test_bp_activity_get_meta_single_true() {
     400        $g = $this->factory->group->create();
     401        groups_add_groupmeta( $g, 'foo', 'bar' );
     402        groups_add_groupmeta( $g, 'foo', 'baz' );
     403        $this->assertSame( 'bar', groups_get_groupmeta( $g, 'foo' ) ); // default is true
     404        $this->assertSame( 'bar', groups_get_groupmeta( $g, 'foo', true ) );
     405    }
     406
     407    /**
     408     * @group groupmeta
     409     * @group groups_get_groupmeta
     410     */
     411    public function test_bp_activity_get_meta_single_false() {
     412        $g = $this->factory->group->create();
     413        groups_add_groupmeta( $g, 'foo', 'bar' );
     414        groups_add_groupmeta( $g, 'foo', 'baz' );
     415        $this->assertSame( array( 'bar', 'baz' ), groups_get_groupmeta( $g, 'foo', false ) );
     416    }
     417
     418    /**
     419     * @group groupmeta
    397420     */
    398421    public function test_groups_delete_groupmeta_non_numeric_id() {
Note: See TracChangeset for help on using the changeset viewer.