Changeset 7047
- Timestamp:
- 05/09/2013 02:11:52 PM (12 years ago)
- Location:
- trunk/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/includes/factory.php
r6905 r7047 31 31 $args['user_id'] = get_current_user_id(); 32 32 33 return $this->get_object_by_id( bp_activity_add( $args ));33 return bp_activity_add( $args ); 34 34 } 35 35 -
trunk/tests/testcases/activity/class.BP_Activity_Activity.php
r7039 r7047 26 26 27 27 $result = BP_Activity_Activity::check_exists_by_content( $content ); 28 $this->assertEquals( $activity ->id, $result );28 $this->assertEquals( $activity, $result ); 29 29 } 30 30 … … 39 39 ) ); 40 40 41 BP_Activity_Activity::delete_activity_item_comments( $parent_activity ->id);41 BP_Activity_Activity::delete_activity_item_comments( $parent_activity ); 42 42 43 43 $result = BP_Activity_Activity::get( array( 'in' => wp_list_pluck( $comments, 'id' ), ) ); … … 53 53 ) ); 54 54 55 bp_activity_update_meta( $activity ->id, 'Paul', 'is cool' );56 BP_Activity_Activity::delete_activity_meta_entries( $activity ->id);55 bp_activity_update_meta( $activity, 'Paul', 'is cool' ); 56 BP_Activity_Activity::delete_activity_meta_entries( $activity ); 57 57 58 $meta = bp_activity_get_meta( $activity ->id, 'Paul' );58 $meta = bp_activity_get_meta( $activity, 'Paul' ); 59 59 $this->assertFalse( $meta ); 60 60 } … … 68 68 69 69 $activity = BP_Activity_Activity::get( array( 70 'in' => $activity ->id,70 'in' => $activity, 71 71 'show_hidden' => true, 72 72 ) ); … … 77 77 $a1 = $this->factory->activity->create(); 78 78 $a2 = $this->factory->activity->create(); 79 bp_activity_update_meta( $a1 ->id, 'foo', 'bar' );79 bp_activity_update_meta( $a1, 'foo', 'bar' ); 80 80 81 81 $activity = BP_Activity_Activity::get( array( … … 88 88 ) ); 89 89 $ids = wp_list_pluck( $activity['activities'], 'id' ); 90 $this->assertEquals( $ids, array( $a1 ->id) );90 $this->assertEquals( $ids, array( $a1 ) ); 91 91 } 92 92 } -
trunk/tests/testcases/activity/template.php
r6948 r7047 24 24 global $bp; 25 25 26 $a ctivity= $this->factory->activity->create( array(26 $a = $this->factory->activity->create( array( 27 27 'type' => 'activity_update', 28 28 ) ); 29 29 30 30 // User can delete his own items 31 $activity = $this->factory->activity->get_object_by_id( $a ); 31 32 $this->assertTrue( bp_activity_user_can_delete( $activity ) ); 32 33 … … 75 76 ) ); 76 77 77 bp_activity_add_user_favorite( $a1 ->id, $user_id );78 bp_activity_add_user_favorite( $a2 ->id, $user_id );78 bp_activity_add_user_favorite( $a1, $user_id ); 79 bp_activity_add_user_favorite( $a2, $user_id ); 79 80 80 81 // groan. It sucks that you have to invoke the global … … 92 93 $ids = wp_list_pluck( $activities_template->activities, 'id' ); 93 94 94 $this->assertEquals( $ids, array( $a1 ->id, $a2->id) );95 $this->assertEquals( $ids, array( $a1, $a2 ) ); 95 96 96 97 $activities_template = null; … … 107 108 $ids = wp_list_pluck( $activities_template->activities, 'id' ); 108 109 109 $this->assertEquals( $ids, array( $a1 ->id) );110 $this->assertEquals( $ids, array( $a1 ) ); 110 111 111 112 $activities_template = null; … … 118 119 $a1 = $this->factory->activity->create(); 119 120 $a2 = $this->factory->activity->create(); 120 bp_activity_update_meta( $a1 ->id, 'foo', 'bar' );121 bp_activity_update_meta( $a1, 'foo', 'bar' ); 121 122 122 123 global $activities_template; … … 131 132 132 133 $ids = wp_list_pluck( $activities_template->activities, 'id' ); 133 $this->assertEquals( $ids, array( $a1 ->id) );134 $this->assertEquals( $ids, array( $a1 ) ); 134 135 } 135 136 } -
trunk/tests/testcases/routing/activity.php
r7039 r7047 28 28 */ 29 29 function test_activity_permalink() { 30 $activity = $this->factory->activity->create(); 30 $a = $this->factory->activity->create(); 31 $activity = $this->factory->activity->get_object_by_id( $a ); 31 32 32 33 $url = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
Note: See TracChangeset
for help on using the changeset viewer.