Changeset 11737 for trunk/tests/phpunit/testcases/blogs/activity.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/blogs/activity.php
r10868 r11737 30 30 } 31 31 32 $b = $this->factory->blog->create();33 $u = $this->factory->user->create();34 $a = $this->factory->activity->create( array(32 $b = self::factory()->blog->create(); 33 $u = self::factory()->user->create(); 34 $a = self::factory()->activity->create( array( 35 35 'component' => buddypress()->blogs->id, 36 36 'type' => 'new_blog', … … 55 55 } 56 56 57 $u = $this->factory->user->create();58 $p = $this->factory->post->create( array(57 $u = self::factory()->user->create(); 58 $p = self::factory()->post->create( array( 59 59 'post_author' => $u, 60 60 ) ); 61 $a = $this->factory->activity->create( array(61 $a = self::factory()->activity->create( array( 62 62 'component' => buddypress()->blogs->id, 63 63 'type' => 'new_blog_post', … … 89 89 } 90 90 91 $u = $this->factory->user->create();92 $p = $this->factory->post->create( array(91 $u = self::factory()->user->create(); 92 $p = self::factory()->post->create( array( 93 93 'post_author' => $u, 94 94 ) ); 95 $a = $this->factory->activity->create( array(95 $a = self::factory()->activity->create( array( 96 96 'component' => buddypress()->blogs->id, 97 97 'type' => 'new_blog_post', … … 123 123 } 124 124 125 $b = $this->factory->blog->create();126 $u = $this->factory->user->create();125 $b = self::factory()->blog->create(); 126 $u = self::factory()->user->create(); 127 127 128 128 switch_to_blog( $b ); 129 $p = $this->factory->post->create( array(129 $p = self::factory()->post->create( array( 130 130 'post_author' => $u, 131 131 ) ); … … 133 133 restore_current_blog(); 134 134 135 $a = $this->factory->activity->create( array(135 $a = self::factory()->activity->create( array( 136 136 'component' => buddypress()->blogs->id, 137 137 'type' => 'new_blog_post', … … 164 164 } 165 165 166 $b = $this->factory->blog->create();167 $u = $this->factory->user->create();166 $b = self::factory()->blog->create(); 167 $u = self::factory()->user->create(); 168 168 169 169 switch_to_blog( $b ); 170 $p = $this->factory->post->create( array(170 $p = self::factory()->post->create( array( 171 171 'post_author' => $u, 172 172 ) ); 173 173 $p_obj = get_post( $p ); 174 $c = $this->factory->comment->create( array(174 $c = self::factory()->comment->create( array( 175 175 'comment_post_ID' => $p, 176 176 ) ); … … 178 178 restore_current_blog(); 179 179 180 $a = $this->factory->activity->create( array(180 $a = self::factory()->activity->create( array( 181 181 'component' => buddypress()->blogs->id, 182 182 'type' => 'new_blog_comment', … … 209 209 add_filter( 'bp_blogs_activity_created_blog_action', array( $this, 'created_blog_passthrough' ), 10, 2 ); 210 210 211 $b = $this->factory->blog->create();212 $u = $this->factory->user->create();211 $b = self::factory()->blog->create(); 212 $u = self::factory()->user->create(); 213 213 214 214 $recorded_blog = new BP_Blogs_Blog; … … 217 217 $recorded_blog_id = $recorded_blog->save(); 218 218 219 $a = $this->factory->activity->create( array(219 $a = self::factory()->activity->create( array( 220 220 'component' => buddypress()->blogs->id, 221 221 'type' => 'new_blog', … … 237 237 add_filter( 'bp_blogs_activity_new_post_action', array( $this, 'new_post_passthrough' ), 10, 2 ); 238 238 239 $b = $this->factory->blog->create();239 $b = self::factory()->blog->create(); 240 240 241 241 switch_to_blog( $b ); 242 $p = $this->factory->post->create();242 $p = self::factory()->post->create(); 243 243 restore_current_blog(); 244 244 245 $u = $this->factory->user->create();246 $a = $this->factory->activity->create( array(245 $u = self::factory()->user->create(); 246 $a = self::factory()->activity->create( array( 247 247 'component' => buddypress()->blogs->id, 248 248 'type' => 'new_blog_post', … … 265 265 add_filter( 'bp_blogs_activity_new_comment_action', array( $this, 'new_comment_passthrough' ), 10, 2 ); 266 266 267 $b = $this->factory->blog->create();267 $b = self::factory()->blog->create(); 268 268 269 269 switch_to_blog( $b ); 270 $p = $this->factory->post->create();271 $c = $this->factory->comment->create( array(270 $p = self::factory()->post->create(); 271 $c = self::factory()->comment->create( array( 272 272 'comment_post_ID' => $p, 273 273 ) ); 274 274 restore_current_blog(); 275 275 276 $u = $this->factory->user->create();277 $a = $this->factory->activity->create( array(276 $u = self::factory()->user->create(); 277 $a = self::factory()->activity->create( array( 278 278 'component' => buddypress()->blogs->id, 279 279 'type' => 'new_blog_comment', … … 296 296 } 297 297 298 $u = $this->factory->user->create();299 $p = $this->factory->post->create( array( 'post_author' => $u, ) );300 $a = $this->factory->activity->create( array(298 $u = self::factory()->user->create(); 299 $p = self::factory()->post->create( array( 'post_author' => $u, ) ); 300 $a = self::factory()->activity->create( array( 301 301 'component' => buddypress()->blogs->id, 302 302 'item_id' => 1, … … 322 322 buddypress()->activity->actions = new stdClass(); 323 323 324 $u = $this->factory->user->create();324 $u = self::factory()->user->create(); 325 325 $p = wp_insert_post( array( 326 326 'post_author' => $u, … … 359 359 buddypress()->activity->actions = new stdClass(); 360 360 361 $u = $this->factory->user->create();361 $u = self::factory()->user->create(); 362 362 $p = wp_insert_post( array( 363 363 'post_author' => $u, … … 409 409 public function test_bp_blogs_sync_add_from_activity_comment() { 410 410 $old_user = get_current_user_id(); 411 $u = $this->factory->user->create();411 $u = self::factory()->user->create(); 412 412 $this->set_current_user( $u ); 413 413 $userdata = get_userdata( $u ); … … 417 417 418 418 // create the blog post 419 $post_id = $this->factory->post->create( array(419 $post_id = self::factory()->post->create( array( 420 420 'post_status' => 'publish', 421 421 'post_type' => 'post', … … 457 457 public function test_bp_blogs_sync_delete_from_activity_comment() { 458 458 $old_user = get_current_user_id(); 459 $u = $this->factory->user->create();459 $u = self::factory()->user->create(); 460 460 $this->set_current_user( $u ); 461 461 $userdata = get_userdata( $u ); … … 465 465 466 466 // create the blog post 467 $post_id = $this->factory->post->create( array(467 $post_id = self::factory()->post->create( array( 468 468 'post_status' => 'publish', 469 469 'post_type' => 'post', … … 505 505 public function test_bp_blogs_sync_activity_edit_to_post_comment_spam_unspam_activity_comment() { 506 506 $old_user = get_current_user_id(); 507 $u = $this->factory->user->create();507 $u = self::factory()->user->create(); 508 508 $this->set_current_user( $u ); 509 509 $userdata = get_userdata( $u ); … … 513 513 514 514 // create the blog post 515 $post_id = $this->factory->post->create( array(515 $post_id = self::factory()->post->create( array( 516 516 'post_status' => 'publish', 517 517 'post_type' => 'post', … … 565 565 public function test_bp_blogs_sync_activity_edit_to_post_comment_spam_activity_comment_unspam_post_comment() { 566 566 $old_user = get_current_user_id(); 567 $u = $this->factory->user->create();567 $u = self::factory()->user->create(); 568 568 $this->set_current_user( $u ); 569 569 $userdata = get_userdata( $u ); … … 573 573 574 574 // create the blog post 575 $post_id = $this->factory->post->create( array(575 $post_id = self::factory()->post->create( array( 576 576 'post_status' => 'publish', 577 577 'post_type' => 'post', … … 623 623 public function test_bp_blogs_sync_activity_edit_to_post_comment_trash_comment_ham_activity() { 624 624 $old_user = get_current_user_id(); 625 $u = $this->factory->user->create();625 $u = self::factory()->user->create(); 626 626 $this->set_current_user( $u ); 627 627 $userdata = get_userdata( $u ); … … 631 631 632 632 // create the blog post 633 $post_id = $this->factory->post->create( array(633 $post_id = self::factory()->post->create( array( 634 634 'post_status' => 'publish', 635 635 'post_type' => 'post', … … 680 680 public function test_spammed_activity_comment_should_not_create_post_comment() { 681 681 $old_user = get_current_user_id(); 682 $u = $this->factory->user->create();682 $u = self::factory()->user->create(); 683 683 $this->set_current_user( $u ); 684 684 $userdata = get_userdata( $u ); … … 688 688 689 689 // create the blog post. 690 $post_id = $this->factory->post->create( array(690 $post_id = self::factory()->post->create( array( 691 691 'post_status' => 'publish', 692 692 'post_type' => 'post',
Note: See TracChangeset
for help on using the changeset viewer.