Changeset 7422 for trunk/tests/testcases/activity/functions.php
- Timestamp:
- 10/13/2013 02:36:04 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/tests/testcases/activity/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/activity/functions.php
r7039 r7422 35 35 } 36 36 37 /** 38 * @group delete 39 */ 40 public function test_delete_activity_and_meta() { 41 // create an activity update 42 $parent_activity = $this->factory->activity->create( array( 43 'type' => 'activity_update', 44 ) ); 45 46 // create some activity comments 47 $comment_one = $this->factory->activity->create( array( 48 'type' => 'activity_comment', 49 'item_id' => $parent_activity, 50 'secondary_item_id' => $parent_activity, 51 ) ); 52 53 $comment_two = $this->factory->activity->create( array( 54 'type' => 'activity_comment', 55 'item_id' => $parent_activity, 56 'secondary_item_id' => $parent_activity, 57 ) ); 58 59 // add some meta to the activity items 60 bp_activity_update_meta( $parent_activity, 'foo', 'bar' ); 61 bp_activity_update_meta( $comment_one, 'foo', 'bar' ); 62 bp_activity_update_meta( $comment_two, 'foo', 'bar' ); 63 64 // now delete the parent activity item 65 // this should hopefully delete the associated comments and meta entries 66 bp_activity_delete( array( 67 'id' => $parent_activity 68 ) ); 69 70 // now fetch the deleted activity entries 71 $get = bp_activity_get( array( 72 'in' => array( $parent_activity, $comment_one, $comment_two ), 73 'display_comments' => 'stream' 74 ) ); 75 76 // activities should equal zero 77 $this->assertEquals( 0, $get['total'] ); 78 79 // now fetch activity meta for the deleted activity entries 80 $m1 = bp_activity_get_meta( $parent_activity ); 81 $m2 = bp_activity_get_meta( $comment_one ); 82 $m3 = bp_activity_get_meta( $comment_two ); 83 84 // test if activity meta entries still exist 85 $this->assertEquals( false, $m1 ); 86 $this->assertEquals( false, $m2 ); 87 $this->assertEquals( false, $m3 ); 88 } 37 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)