- Timestamp:
- 06/04/2013 06:13:29 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/activity/class.BP_Activity_Activity.php
r7127 r7155 162 162 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 163 163 ) ); 164 165 // bp_activity_new_comment() doesn't allow date_recorded 166 $a3 = bp_activity_add( array( 167 'action' => sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_get_loggedin_user_link() ) , 168 'content' => 'Candy is good', 169 'component' => buddypress()->activity->id, 170 'type' => 'activity_comment', 171 'user_id' => bp_loggedin_user_id, 172 'item_id' => $a1, 173 'secondary_item_id' => $a1, 174 'recorded_time' => date( 'Y-m-d H:i:s', $now - 50 ), 175 ) ); 176 177 $activity = BP_Activity_Activity::get( array( 178 'display_comments' => 'stream', 179 ) ); 180 $ids = wp_list_pluck( $activity['activities'], 'id' ); 181 $this->assertEquals( array( $a1, $a3, $a2 ), $ids ); 182 } 183 184 /** 185 * @group get 186 */ 187 public function test_get_with_display_comments_false() { 188 $now = time(); 189 $a1 = $this->factory->activity->create( array( 190 'content' => 'Life Rules', 191 'recorded_time' => date( 'Y-m-d H:i:s', $now ), 192 ) ); 193 $a2 = $this->factory->activity->create( array( 194 'content' => 'Life Drools', 195 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 196 ) ); 164 197 $a3 = bp_activity_new_comment( array( 165 198 'activity_id' => $a1, … … 169 202 170 203 $activity = BP_Activity_Activity::get( array( 171 'display_comments' => 'stream',172 ) );173 $ids = wp_list_pluck( $activity['activities'], 'id' );174 $this->assertEquals( array( $a1, $a3, $a2 ), $ids );175 }176 177 /**178 * @group get179 */180 public function test_get_with_display_comments_false() {181 $now = time();182 $a1 = $this->factory->activity->create( array(183 'content' => 'Life Rules',184 'recorded_time' => date( 'Y-m-d H:i:s', $now ),185 ) );186 $a2 = $this->factory->activity->create( array(187 'content' => 'Life Drools',188 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),189 ) );190 $a3 = bp_activity_new_comment( array(191 'activity_id' => $a1,192 'content' => 'Candy is good',193 'recorded_time' => date( 'Y-m-d H:i:s', $now - 50 ),194 ) );195 196 $activity = BP_Activity_Activity::get( array(197 204 'display_comments' => false, 198 205 ) );
Note: See TracChangeset
for help on using the changeset viewer.