Changeset 42343 for trunk/tests/phpunit/tests/comment/wpCountComments.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/wpCountComments.php
r35242 r42343 16 16 17 17 public function test_wp_count_comments_approved() { 18 self::factory()->comment->create( array( 19 'comment_approved' => 1 20 ) ); 18 self::factory()->comment->create( 19 array( 20 'comment_approved' => 1, 21 ) 22 ); 21 23 22 24 $count = wp_count_comments(); … … 32 34 33 35 public function test_wp_count_comments_awaiting() { 34 self::factory()->comment->create( array( 35 'comment_approved' => 0 36 ) ); 36 self::factory()->comment->create( 37 array( 38 'comment_approved' => 0, 39 ) 40 ); 37 41 38 42 $count = wp_count_comments(); … … 48 52 49 53 public function test_wp_count_comments_spam() { 50 self::factory()->comment->create( array( 51 'comment_approved' => 'spam' 52 ) ); 54 self::factory()->comment->create( 55 array( 56 'comment_approved' => 'spam', 57 ) 58 ); 53 59 54 60 $count = wp_count_comments(); … … 64 70 65 71 public function test_wp_count_comments_trash() { 66 self::factory()->comment->create( array( 67 'comment_approved' => 'trash' 68 ) ); 72 self::factory()->comment->create( 73 array( 74 'comment_approved' => 'trash', 75 ) 76 ); 69 77 70 78 $count = wp_count_comments(); … … 80 88 81 89 public function test_wp_count_comments_post_trashed() { 82 self::factory()->comment->create( array( 83 'comment_approved' => 'post-trashed' 84 ) ); 90 self::factory()->comment->create( 91 array( 92 'comment_approved' => 'post-trashed', 93 ) 94 ); 85 95 86 96 $count = wp_count_comments(); … … 96 106 97 107 public function test_wp_count_comments_cache() { 98 $post_id = self::factory()->post->create( array( 99 'post_status' => 'publish' 100 ) ); 101 $comment_id = self::factory()->comment->create( array( 102 'comment_approved' => '1', 103 'comment_post_ID' => $post_id 104 ) ); 108 $post_id = self::factory()->post->create( 109 array( 110 'post_status' => 'publish', 111 ) 112 ); 113 $comment_id = self::factory()->comment->create( 114 array( 115 'comment_approved' => '1', 116 'comment_post_ID' => $post_id, 117 ) 118 ); 105 119 106 120 $count1 = wp_count_comments( $post_id );
Note: See TracChangeset
for help on using the changeset viewer.