Changeset 13792 for trunk/tests/phpunit/testcases/xprofile/functions.php
- Timestamp:
- 04/12/2024 01:12:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/xprofile/functions.php
r13314 r13792 699 699 700 700 /** 701 * @ticket BP9130 702 */ 703 public function test_xprofile_update_keep_parent_id() { 704 $g = self::factory()->xprofile_group->create(); 705 $parent = self::factory()->xprofile_field->create( array( 706 'field_group_id' => $g, 707 'type' => 'selectbox', 708 'name' => 'Parent', 709 ) ); 710 711 $f = xprofile_insert_field( 712 array( 713 'field_group_id' => $g, 714 'parent_id' => $parent, 715 'type' => 'option', 716 'name' => 'Option 1', 717 'option_order' => 5, 718 ) 719 ); 720 721 $field = new BP_XProfile_Field( $f ); 722 723 $this->assertEquals( $parent, $field->parent_id ); 724 $this->assertNotEquals( 0, $field->parent_id ); 725 726 $field->name = 'Option 2'; 727 $field->save(); // Perform the `UPDATE` query. The reason for the bug. 728 729 // Fetch the new DB value. 730 $field = new BP_XProfile_Field( $f ); 731 732 $this->assertNotEquals( 0, $field->parent_id ); 733 $this->assertEquals( $parent, $field->parent_id ); 734 } 735 736 /** 701 737 * @group xprofile_insert_field 702 738 */
Note: See TracChangeset
for help on using the changeset viewer.