Changeset 35225 for trunk/tests/phpunit/tests/comment.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment.php
r35224 r35225 22 22 23 23 function test_wp_update_comment() { 24 $post = $this->factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) );25 $post2 = $this->factory->post->create_and_get( array( 'post_title' => 'some-post-2', 'post_type' => 'post' ) );26 $comments = $this->factory->comment->create_post_comments( $post->ID, 5 );24 $post = self::$factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) ); 25 $post2 = self::$factory->post->create_and_get( array( 'post_title' => 'some-post-2', 'post_type' => 'post' ) ); 26 $comments = self::$factory->comment->create_post_comments( $post->ID, 5 ); 27 27 $result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) ); 28 28 $this->assertEquals( 1, $result ); … … 40 40 */ 41 41 function test_wp_update_comment_updates_comment_type() { 42 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );42 $comment_id = self::$factory->comment->create( array( 'comment_post_ID' => self::$post_id ) ); 43 43 44 44 wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_type' => 'pingback' ) ); … … 52 52 */ 53 53 function test_wp_update_comment_updates_user_id() { 54 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );54 $comment_id = self::$factory->comment->create( array( 'comment_post_ID' => self::$post_id ) ); 55 55 56 56 wp_update_comment( array( 'comment_ID' => $comment_id, 'user_id' => 1 ) ); … … 61 61 62 62 public function test_get_approved_comments() { 63 $ca1 = $this->factory->comment->create( array(63 $ca1 = self::$factory->comment->create( array( 64 64 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' 65 65 ) ); 66 $ca2 = $this->factory->comment->create( array(66 $ca2 = self::$factory->comment->create( array( 67 67 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' 68 68 ) ); 69 $ca3 = $this->factory->comment->create( array(69 $ca3 = self::$factory->comment->create( array( 70 70 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' 71 71 ) ); 72 $c2 = $this->factory->comment->create( array(72 $c2 = self::$factory->comment->create( array( 73 73 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' 74 74 ) ); 75 $c3 = $this->factory->comment->create( array(75 $c3 = self::$factory->comment->create( array( 76 76 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' 77 77 ) ); 78 $c4 = $this->factory->comment->create( array(78 $c4 = self::$factory->comment->create( array( 79 79 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' 80 80 ) ); 81 $c5 = $this->factory->comment->create( array(81 $c5 = self::$factory->comment->create( array( 82 82 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' 83 83 ) ); … … 93 93 */ 94 94 public function test_get_approved_comments_with_post_id_0_should_return_empty_array() { 95 $ca1 = $this->factory->comment->create( array(95 $ca1 = self::$factory->comment->create( array( 96 96 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' 97 97 ) ); … … 257 257 */ 258 258 public function test_wp_notify_moderator_should_not_throw_notice_when_post_author_is_0() { 259 $p = $this->factory->post->create( array(259 $p = self::$factory->post->create( array( 260 260 'post_author' => 0, 261 261 ) ); 262 262 263 $c = $this->factory->comment->create( array(263 $c = self::$factory->comment->create( array( 264 264 'comment_post_ID' => $p, 265 265 ) ); … … 272 272 */ 273 273 public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_marked_as_spam() { 274 $c = $this->factory->comment->create( array(274 $c = self::$factory->comment->create( array( 275 275 'comment_post_ID' => self::$post_id, 276 276 'comment_approved' => 'spam', … … 285 285 */ 286 286 public function test_wp_new_comment_with_meta() { 287 $c = $this->factory->comment->create( array(287 $c = self::$factory->comment->create( array( 288 288 'comment_approved' => '1', 289 289 'comment_meta' => array( … … 300 300 */ 301 301 public function test_wp_comment_get_children_should_fill_children() { 302 $c1 = $this->factory->comment->create( array(303 'comment_post_ID' => self::$post_id, 304 'comment_approved' => '1', 305 ) ); 306 307 $c2 = $this->factory->comment->create( array(302 $c1 = self::$factory->comment->create( array( 303 'comment_post_ID' => self::$post_id, 304 'comment_approved' => '1', 305 ) ); 306 307 $c2 = self::$factory->comment->create( array( 308 308 'comment_post_ID' => self::$post_id, 309 309 'comment_approved' => '1', … … 311 311 ) ); 312 312 313 $c3 = $this->factory->comment->create( array(313 $c3 = self::$factory->comment->create( array( 314 314 'comment_post_ID' => self::$post_id, 315 315 'comment_approved' => '1', … … 317 317 ) ); 318 318 319 $c4 = $this->factory->comment->create( array(319 $c4 = self::$factory->comment->create( array( 320 320 'comment_post_ID' => self::$post_id, 321 321 'comment_approved' => '1', … … 323 323 ) ); 324 324 325 $c5 = $this->factory->comment->create( array(326 'comment_post_ID' => self::$post_id, 327 'comment_approved' => '1', 328 ) ); 329 330 $c6 = $this->factory->comment->create( array(325 $c5 = self::$factory->comment->create( array( 326 'comment_post_ID' => self::$post_id, 327 'comment_approved' => '1', 328 ) ); 329 330 $c6 = self::$factory->comment->create( array( 331 331 'comment_post_ID' => self::$post_id, 332 332 'comment_approved' => '1', … … 348 348 */ 349 349 public function test_post_properties_should_be_lazyloaded() { 350 $c = $this->factory->comment->create( array( 'comment_post_ID' => self::$post_id ) );350 $c = self::$factory->comment->create( array( 'comment_post_ID' => self::$post_id ) ); 351 351 352 352 $post = get_post( self::$post_id );
Note: See TracChangeset
for help on using the changeset viewer.