Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
r40417 r42343 7 7 8 8 function test_invalid_username_password() { 9 $post = array();9 $post = array(); 10 10 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) ); 11 11 $this->assertIXRError( $result ); … … 16 16 $this->make_user_by_role( 'subscriber' ); 17 17 18 $post = array();18 $post = array(); 19 19 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) ); 20 20 $this->assertIXRError( $result ); … … 25 25 $this->make_user_by_role( 'author' ); 26 26 27 $post = array();27 $post = array(); 28 28 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 29 29 $this->assertIXRError( $result ); … … 35 35 $this->make_user_by_role( 'author' ); 36 36 37 $post = array( 'title' => 'Test' );37 $post = array( 'title' => 'Test' ); 38 38 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 39 39 $this->assertNotIXRError( $result ); … … 44 44 $this->make_user_by_role( 'author' ); 45 45 46 $post = array( 'title' => 'Test', 'ID' => 103948 ); 46 $post = array( 47 'title' => 'Test', 48 'ID' => 103948, 49 ); 47 50 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 48 51 $this->assertNotIXRError( $result ); … … 53 56 $this->make_user_by_role( 'author' ); 54 57 55 $post = array( 'title' => 'Test', 'post_status' => 'publish' ); 58 $post = array( 59 'title' => 'Test', 60 'post_status' => 'publish', 61 ); 56 62 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 57 63 $this->assertNotIXRError( $result ); … … 61 67 $this->make_user_by_role( 'contributor' ); 62 68 63 $post = array( 'title' => 'Test', 'post_status' => 'publish' ); 69 $post = array( 70 'title' => 'Test', 71 'post_status' => 'publish', 72 ); 64 73 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) ); 65 74 $this->assertIXRError( $result ); … … 71 80 $other_author_id = $this->make_user_by_role( 'author' ); 72 81 73 $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id ); 82 $post = array( 83 'title' => 'Test', 84 'wp_author_id' => $other_author_id, 85 ); 74 86 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 75 87 $this->assertNotIXRError( $result ); … … 80 92 $other_author_id = $this->make_user_by_role( 'author' ); 81 93 82 $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id ); 94 $post = array( 95 'title' => 'Test', 96 'wp_author_id' => $other_author_id, 97 ); 83 98 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) ); 84 99 $this->assertIXRError( $result ); … … 92 107 $this->make_user_by_role( 'editor' ); 93 108 94 $post = array( 'title' => 'Test', 'wp_author_id' => 99999999 ); 109 $post = array( 110 'title' => 'Test', 111 'wp_author_id' => 99999999, 112 ); 95 113 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 96 114 $this->assertIXRError( $result ); … … 101 119 $my_author_id = $this->make_user_by_role( 'author' ); 102 120 103 $post = array( 'title' => 'Test' );121 $post = array( 'title' => 'Test' ); 104 122 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 105 123 $this->assertNotIXRError( $result ); … … 117 135 118 136 // create attachment 119 $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );137 $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' ); 120 138 $attachment_id = self::factory()->attachment->create_upload_object( $filename ); 121 139 122 $post = array( 'title' => 'Post Thumbnail Test', 'wp_post_thumbnail' => $attachment_id ); 140 $post = array( 141 'title' => 'Post Thumbnail Test', 142 'wp_post_thumbnail' => $attachment_id, 143 ); 123 144 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 124 145 $this->assertNotIXRError( $result ); … … 131 152 $this->make_user_by_role( 'author' ); 132 153 133 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 154 $post = array( 155 'title' => 'Test', 156 'post_type' => 'page', 157 ); 134 158 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 135 159 $this->assertIXRError( $result ); … … 140 164 $this->make_user_by_role( 'editor' ); 141 165 142 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 166 $post = array( 167 'title' => 'Test', 168 'post_type' => 'page', 169 ); 143 170 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 144 171 $this->assertNotIXRError( $result ); … … 157 184 $this->make_user_by_role( 'editor' ); 158 185 159 $post = array(160 'title' => 'Test',161 'post_type' => 'post',162 'post_status' => 'draft' 186 $post = array( 187 'title' => 'Test', 188 'post_type' => 'post', 189 'post_status' => 'draft', 163 190 ); 164 191 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
Note: See TracChangeset
for help on using the changeset viewer.