Changeset 48937 for trunk/tests/phpunit/tests/xmlrpc/wp/editPost.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/editPost.php
r47122 r48937 9 9 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'username', 'password', 0, array() ) ); 10 10 $this->assertIXRError( $result ); 11 $this->assert Equals( 403, $result->code );11 $this->assertSame( 403, $result->code ); 12 12 } 13 13 … … 28 28 29 29 $out = get_post( $post_id ); 30 $this->assert Equals( $new_title, $out->post_title );30 $this->assertSame( $new_title, $out->post_title ); 31 31 } 32 32 … … 48 48 49 49 $out = get_post( $post_id ); 50 $this->assert Equals( $new_title, $out->post_title );50 $this->assertSame( $new_title, $out->post_title ); 51 51 } 52 52 … … 66 66 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) ); 67 67 $this->assertIXRError( $result ); 68 $this->assert Equals( 401, $result->code );69 70 $out = get_post( $post_id ); 71 $this->assert Equals( $original_title, $out->post_title );68 $this->assertSame( 401, $result->code ); 69 70 $out = get_post( $post_id ); 71 $this->assertSame( $original_title, $out->post_title ); 72 72 } 73 73 … … 105 105 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) ); 106 106 $this->assertIXRError( $result ); 107 $this->assert Equals( 401, $result->code );107 $this->assertSame( 401, $result->code ); 108 108 109 109 $out = get_post( $post_id ); … … 144 144 $post_id = wp_insert_post( $post ); 145 145 146 $this->assert Equals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );146 $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) ); 147 147 148 148 // Create attachment. … … 182 182 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post5 ) ); 183 183 $this->assertNotIXRError( $result ); 184 $this->assert Equals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );184 $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) ); 185 185 186 186 // Use invalid ID. … … 188 188 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post6 ) ); 189 189 $this->assertIXRError( $result ); 190 $this->assert Equals( 404, $result->code );190 $this->assertSame( 404, $result->code ); 191 191 192 192 remove_theme_support( 'post-thumbnails' ); … … 227 227 228 228 $out = get_post( $post_id ); 229 $this->assert Equals( $new_title, $out->post_title );229 $this->assertSame( $new_title, $out->post_title ); 230 230 231 231 $edited_object = get_metadata_by_mid( 'post', $mid_edit ); 232 $this->assert Equals( '87654321', $edited_object->meta_value );232 $this->assertSame( '87654321', $edited_object->meta_value ); 233 233 $this->assertFalse( get_metadata_by_mid( 'post', $mid_delete ) ); 234 234 235 235 $created_object = get_post_meta( $post_id, 'custom_field_to_create', true ); 236 $this->assert Equals( $created_object, '12345678' );236 $this->assertSame( $created_object, '12345678' ); 237 237 } 238 238 … … 288 288 289 289 // Make sure the edit went through. 290 $this->assert Equals( 'First edit', get_post( $post_id )->post_content );290 $this->assertSame( 'First edit', get_post( $post_id )->post_content ); 291 291 292 292 // Modify it again. We think it was last modified yesterday, but we actually just modified it above. … … 297 297 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) ); 298 298 $this->assertIXRError( $result ); 299 $this->assert Equals( 409, $result->code );299 $this->assertSame( 409, $result->code ); 300 300 301 301 // Make sure the edit did not go through. 302 $this->assert Equals( 'First edit', get_post( $post_id )->post_content );302 $this->assertSame( 'First edit', get_post( $post_id )->post_content ); 303 303 } 304 304 … … 321 321 322 322 // Make sure that the post status is still inherit. 323 $this->assert Equals( 'inherit', get_post( $post_id )->post_status );323 $this->assertSame( 'inherit', get_post( $post_id )->post_status ); 324 324 } 325 325 … … 340 340 341 341 // Make sure that the post status is still inherit. 342 $this->assert Equals( 'draft', get_post( $post_id )->post_status );342 $this->assertSame( 'draft', get_post( $post_id )->post_status ); 343 343 } 344 344 … … 368 368 ); 369 369 $this->assertNotIXRError( $result ); 370 $this->assert Equals( 'Updated', get_post( $post_id )->post_title );370 $this->assertSame( 'Updated', get_post( $post_id )->post_title ); 371 371 372 372 $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' ); … … 395 395 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) ); 396 396 $this->assertNotIXRError( $result ); 397 $this->assert Equals( 'Updated', get_post( $post_id )->post_title );397 $this->assertSame( 'Updated', get_post( $post_id )->post_title ); 398 398 399 399 $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' ); … … 437 437 438 438 // Verify that the correct data is there. 439 $this->assert Equals( $enclosure_string, get_post_meta( $post_id, 'enclosure', true ) );439 $this->assertSame( $enclosure_string, get_post_meta( $post_id, 'enclosure', true ) ); 440 440 441 441 // Attempt to add the enclosure a second time. … … 443 443 444 444 // Verify that there is only a single value in the array and that a duplicate is not present. 445 $this->assert Equals( 1, count( get_post_meta( $post_id, 'enclosure' ) ) );445 $this->assertSame( 1, count( get_post_meta( $post_id, 'enclosure' ) ) ); 446 446 447 447 // For good measure, check that the expected value is in the array. … … 452 452 453 453 // Having added the new enclosure, 2 values are expected in the array. 454 $this->assert Equals( 2, count( get_post_meta( $post_id, 'enclosure' ) ) );454 $this->assertSame( 2, count( get_post_meta( $post_id, 'enclosure' ) ) ); 455 455 456 456 // Check that the new enclosure is in the enclosure meta. … … 492 492 493 493 $after = get_post( $post_id ); 494 $this->assert Equals( 'future', $after->post_status );494 $this->assertSame( 'future', $after->post_status ); 495 495 496 496 $future_date_string = strftime( '%Y-%m-%d %H:%M:%S', $future_time ); 497 $this->assert Equals( $future_date_string, $after->post_date );497 $this->assertSame( $future_date_string, $after->post_date ); 498 498 } 499 499 … … 512 512 513 513 $before = get_post( $post_id ); 514 $this->assert Equals( '0000-00-00 00:00:00', $before->post_date_gmt );514 $this->assertSame( '0000-00-00 00:00:00', $before->post_date_gmt ); 515 515 516 516 // Edit the post without specifying any dates. … … 524 524 // The published date should still be zero. 525 525 $after = get_post( $post_id ); 526 $this->assert Equals( '0000-00-00 00:00:00', $after->post_date_gmt );526 $this->assertSame( '0000-00-00 00:00:00', $after->post_date_gmt ); 527 527 } 528 528 }
Note: See TracChangeset
for help on using the changeset viewer.