Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php
r40417 r42343 9 9 $this->make_user_by_role( 'administrator' ); 10 10 $post = self::factory()->post->create_and_get(); 11 12 $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array( 13 'content' => rand_str( 100 ) 14 ) ) ); 15 11 12 $result = $this->myxmlrpcserver->wp_newComment( 13 array( 14 1, 15 'administrator', 16 'administrator', 17 $post->ID, 18 array( 19 'content' => rand_str( 100 ), 20 ), 21 ) 22 ); 23 16 24 $this->assertNotIXRError( $result ); 17 25 } 18 26 19 27 function test_empty_comment() { 20 28 $this->make_user_by_role( 'administrator' ); 21 29 $post = self::factory()->post->create_and_get(); 22 23 $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array( 24 'content' => '' 25 ) ) ); 26 30 31 $result = $this->myxmlrpcserver->wp_newComment( 32 array( 33 1, 34 'administrator', 35 'administrator', 36 $post->ID, 37 array( 38 'content' => '', 39 ), 40 ) 41 ); 42 27 43 $this->assertIXRError( $result ); 28 44 $this->assertEquals( 403, $result->code ); … … 31 47 function test_new_comment_post_closed() { 32 48 $this->make_user_by_role( 'administrator' ); 33 $post = self::factory()->post->create_and_get( array( 34 'comment_status' => 'closed' 35 ) ); 49 $post = self::factory()->post->create_and_get( 50 array( 51 'comment_status' => 'closed', 52 ) 53 ); 36 54 37 55 $this->assertEquals( 'closed', $post->comment_status ); 38 56 39 $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array( 40 'content' => rand_str( 100 ), 41 ) ) ); 57 $result = $this->myxmlrpcserver->wp_newComment( 58 array( 59 1, 60 'administrator', 61 'administrator', 62 $post->ID, 63 array( 64 'content' => rand_str( 100 ), 65 ), 66 ) 67 ); 42 68 43 69 $this->assertIXRError( $result ); … … 49 75 $post = self::factory()->post->create_and_get(); 50 76 51 $comment_args = array( 1, 'administrator', 'administrator', $post->ID, array( 52 'content' => rand_str( 100 ), 53 ) ); 77 $comment_args = array( 78 1, 79 'administrator', 80 'administrator', 81 $post->ID, 82 array( 83 'content' => rand_str( 100 ), 84 ), 85 ); 54 86 55 87 // First time it's a valid comment 56 $result = $this->myxmlrpcserver->wp_newComment( $comment_args );88 $result = $this->myxmlrpcserver->wp_newComment( $comment_args ); 57 89 $this->assertNotIXRError( $result ); 58 90
Note: See TracChangeset
for help on using the changeset viewer.