Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 01:41:22 PM (10 years ago)
Author:
boonebgorges
Message:

Introduce bp_xprofile_add_meta().

See #5400

File:
1 edited

Legend:

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

    r7873 r7878  
    377377        $this->assertFalse( bp_xprofile_update_meta( $g, 'group', 'foo', 'bar' ) );
    378378    }
     379
     380    /**
     381     * @group xprofilemeta
     382     * @group bp_xprofile_add_meta
     383     */
     384    public function test_bp_xprofile_add_meta_no_meta_key() {
     385        $this->assertFalse( bp_xprofile_add_meta( 1, 'group', '', 'bar' ) );
     386    }
     387
     388    /**
     389     * @group xprofilemeta
     390     * @group bp_xprofile_add_meta
     391     */
     392    public function test_bp_xprofile_add_meta_empty_object_id() {
     393        $this->assertFalse( bp_xprofile_add_meta( 0, 'group', 'foo', 'bar' ) );
     394    }
     395
     396    /**
     397     * @group xprofilemeta
     398     * @group bp_xprofile_add_meta
     399     */
     400    public function test_bp_xprofile_add_meta_existing_unique() {
     401        $g = $this->factory->xprofile_group->create();
     402        bp_xprofile_add_meta( $g, 'group', 'foo', 'bar' );
     403        $this->assertFalse( bp_xprofile_add_meta( $g, 'group', 'foo', 'baz', true ) );
     404    }
     405
     406    /**
     407     * @group xprofilemeta
     408     * @group bp_xprofile_add_meta
     409     */
     410    public function test_bp_xprofile_add_meta_existing_not_unique() {
     411        $g = $this->factory->xprofile_group->create();
     412        bp_xprofile_add_meta( $g, 'group', 'foo', 'bar' );
     413        $this->assertNotEmpty( bp_xprofile_add_meta( $g, 'group', 'foo', 'baz' ) );
     414    }
    379415}
Note: See TracChangeset for help on using the changeset viewer.