Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/09/2015 12:28:55 AM (9 years ago)
Author:
boonebgorges
Message:

BP_XProfile_Group::save() should not return false when a save is successful but no rows are updated.

It ought to be semantically possible to save a fieldgroup without making any
changes to the group. Otherwise the return values of the save() method are
inconsistent, and the 'xprofile_group_after_save' hook is not fired reliably.

Props Offereins.
Fixes #6552.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-group.php

    r9819 r10002  
    66 */
    77class BP_Tests_BP_XProfile_Group extends BP_UnitTestCase {
     8
     9    /**
     10     * @ticket BP6552
     11     */
     12    public function test_save_should_not_return_false_when_no_fields_have_been_altered() {
     13        $g = $this->factory->xprofile_group->create();
     14        $group = new BP_XProfile_Group( $g );
     15
     16        $saved = $group->save();
     17
     18        $this->assertEquals( $g, $saved );
     19    }
     20
    821    /**
    922     * @group fetch_visibility_level
Note: See TracChangeset for help on using the changeset viewer.