Changeset 11737 for trunk/tests/phpunit/testcases/blogs/filters.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/blogs/filters.php
r11256 r11737 46 46 */ 47 47 public function test_bp_activity_catch_transition_post_type_status() { 48 $post_id = $this->factory->post->create( array(48 $post_id = self::factory()->post->create( array( 49 49 'post_status' => 'publish', 50 50 'post_type' => 'using_old_filter', … … 59 59 */ 60 60 public function test_bp_blogs_record_comment() { 61 $u = $this->factory->user->create();62 $user = $this->factory->user->get_object_by_id( $u );61 $u = self::factory()->user->create(); 62 $user = self::factory()->user->get_object_by_id( $u ); 63 63 64 $post_id = $this->factory->post->create( array(64 $post_id = self::factory()->post->create( array( 65 65 'post_status' => 'publish', 66 66 'post_type' => 'using_old_filter', … … 68 68 ) ); 69 69 70 $comment_id = $this->factory->comment->create( array(70 $comment_id = self::factory()->comment->create( array( 71 71 'user_id' => $u, 72 72 'comment_author_email' => $user->user_email, … … 75 75 76 76 // Approve the comment 77 $this->factory->comment->update_object( $comment_id, array( 'comment_approved' => 1 ) );77 self::factory()->comment->update_object( $comment_id, array( 'comment_approved' => 1 ) ); 78 78 79 79 $this->assertTrue( $this->activity_exists_for_post_type( get_current_blog_id(), $comment_id, 'new_blog_comment' ), 'Generated activity for comments about a post type registering using the bp_blogs_record_post_post_types filter should have a new_blog_comment action' ); … … 85 85 */ 86 86 public function test_bp_blogs_record_comment_sync_activity_comment() { 87 $u = $this->factory->user->create();88 $user = $this->factory->user->get_object_by_id( $u );87 $u = self::factory()->user->create(); 88 $user = self::factory()->user->get_object_by_id( $u ); 89 89 90 90 add_filter( 'bp_disable_blogforum_comments', '__return_false' ); 91 91 92 $post_id = $this->factory->post->create( array(92 $post_id = self::factory()->post->create( array( 93 93 'post_status' => 'publish', 94 94 'post_type' => 'using_old_filter', … … 103 103 ) ); 104 104 105 $comment_id = $this->factory->comment->create( array(105 $comment_id = self::factory()->comment->create( array( 106 106 'user_id' => $u, 107 107 'comment_author_email' => $user->user_email, … … 110 110 111 111 // Approve the comment 112 $this->factory->comment->update_object( $comment_id, array( 'comment_approved' => 1 ) );112 self::factory()->comment->update_object( $comment_id, array( 'comment_approved' => 1 ) ); 113 113 114 114 $this->assertTrue( $this->activity_exists_for_post_type( $parent_activity_id, '', 'activity_comment', 'stream' ), 'Generated activity for comments about a post type registering using the bp_blogs_record_post_post_types filter having sync on should have a activity_comment action' );
Note: See TracChangeset
for help on using the changeset viewer.