Changeset 48937 for trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
r47122 r48937 9 9 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) ); 10 10 $this->assertIXRError( $result ); 11 $this->assert Equals( 403, $result->code );11 $this->assertSame( 403, $result->code ); 12 12 } 13 13 … … 17 17 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) ); 18 18 $this->assertIXRError( $result ); 19 $this->assert Equals( 401, $result->code );19 $this->assertSame( 401, $result->code ); 20 20 } 21 21 … … 25 25 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) ); 26 26 $this->assertIXRError( $result ); 27 $this->assert Equals( 500, $result->code );28 $this->assert Equals( 'Content, title, and excerpt are empty.', $result->message );27 $this->assertSame( 500, $result->code ); 28 $this->assertSame( 'Content, title, and excerpt are empty.', $result->message ); 29 29 } 30 30 … … 70 70 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) ); 71 71 $this->assertIXRError( $result ); 72 $this->assert Equals( 401, $result->code );72 $this->assertSame( 401, $result->code ); 73 73 } 74 74 … … 93 93 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) ); 94 94 $this->assertIXRError( $result ); 95 $this->assert Equals( 401, $result->code );95 $this->assertSame( 401, $result->code ); 96 96 } 97 97 … … 118 118 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) ); 119 119 $this->assertIXRError( $result ); 120 $this->assert Equals( 401, $result->code );120 $this->assertSame( 401, $result->code ); 121 121 } 122 122 … … 130 130 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 131 131 $this->assertIXRError( $result ); 132 $this->assert Equals( 404, $result->code );132 $this->assertSame( 404, $result->code ); 133 133 } 134 134 … … 143 143 $out = get_post( $result ); 144 144 $this->assertEquals( $my_author_id, $out->post_author ); 145 $this->assert Equals( 'Test', $out->post_title );145 $this->assertSame( 'Test', $out->post_title ); 146 146 } 147 147 … … 175 175 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) ); 176 176 $this->assertNotIXRError( $result ); 177 $this->assert Equals( 'draft', get_post_status( $result ) );177 $this->assertSame( 'draft', get_post_status( $result ) ); 178 178 } 179 179 … … 187 187 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) ); 188 188 $this->assertIXRError( $result ); 189 $this->assert Equals( 401, $result->code );189 $this->assertSame( 401, $result->code ); 190 190 } 191 191 … … 212 212 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 213 213 $this->assertIXRError( $result ); 214 $this->assert Equals( 401, $result->code );214 $this->assertSame( 401, $result->code ); 215 215 } 216 216 … … 224 224 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 225 225 $this->assertNotIXRError( $result ); 226 $this->assert Equals( 'quote', get_post_format( $result ) );226 $this->assertSame( 'quote', get_post_format( $result ) ); 227 227 } 228 228 … … 250 250 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 251 251 $this->assertIXRError( $result ); 252 $this->assert Equals( 401, $result->code );252 $this->assertSame( 401, $result->code ); 253 253 254 254 $post2 = array( … … 260 260 $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) ); 261 261 $this->assertIXRError( $result2 ); 262 $this->assert Equals( 401, $result2->code );262 $this->assertSame( 401, $result2->code ); 263 263 } 264 264 … … 274 274 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 275 275 $this->assertIXRError( $result ); 276 $this->assert Equals( 403, $result->code );276 $this->assertSame( 403, $result->code ); 277 277 } 278 278 … … 339 339 $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) ); 340 340 $this->assertIXRError( $result2 ); 341 $this->assert Equals( 401, $result2->code );341 $this->assertSame( 401, $result2->code ); 342 342 } 343 343 … … 356 356 $fetched_post = get_post( $result ); 357 357 $this->assertStringMatchesFormat( '%d', $result ); 358 $this->assert Equals( current_time( 'Y-m-d' ), substr( $fetched_post->post_date, 0, 10 ) );358 $this->assertSame( current_time( 'Y-m-d' ), substr( $fetched_post->post_date, 0, 10 ) ); 359 359 } 360 360 … … 373 373 $fetched_post = get_post( $result ); 374 374 $this->assertStringMatchesFormat( '%d', $result ); 375 $this->assert Equals( '0000-00-00', substr( $fetched_post->post_date_gmt, 0, 10 ) );375 $this->assertSame( '0000-00-00', substr( $fetched_post->post_date_gmt, 0, 10 ) ); 376 376 } 377 377 … … 390 390 $fetched_post = get_post( $result ); 391 391 $this->assertStringMatchesFormat( '%d', $result ); 392 $this->assert Equals( $date_string, $fetched_post->post_date );392 $this->assertSame( $date_string, $fetched_post->post_date ); 393 393 } 394 394 … … 407 407 $fetched_post = get_post( $result ); 408 408 $this->assertStringMatchesFormat( '%d', $result ); 409 $this->assert Equals( $date_string, $fetched_post->post_date_gmt );409 $this->assertSame( $date_string, $fetched_post->post_date_gmt ); 410 410 } 411 411 … … 424 424 $fetched_post = get_post( $result ); 425 425 $this->assertStringMatchesFormat( '%d', $result ); 426 $this->assert Equals( $date_string, $fetched_post->post_date );426 $this->assertSame( $date_string, $fetched_post->post_date ); 427 427 } 428 428 … … 441 441 $fetched_post = get_post( $result ); 442 442 $this->assertStringMatchesFormat( '%d', $result ); 443 $this->assert Equals( $date_string, $fetched_post->post_date_gmt );443 $this->assertSame( $date_string, $fetched_post->post_date_gmt ); 444 444 } 445 445
Note: See TracChangeset
for help on using the changeset viewer.