Changeset 48937 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r48911 r48937 86 86 $out = get_post( $id ); 87 87 88 $this->assert Equals( $post['post_content'], $out->post_content );89 $this->assert Equals( $post['post_title'], $out->post_title );90 $this->assert Equals( $post['post_status'], $out->post_status );88 $this->assertSame( $post['post_content'], $out->post_content ); 89 $this->assertSame( $post['post_title'], $out->post_title ); 90 $this->assertSame( $post['post_status'], $out->post_status ); 91 91 $this->assertEquals( $post['post_author'], $out->post_author ); 92 92 … … 94 94 $pcache = wp_cache_get( $id, 'posts' ); 95 95 $this->assertInstanceOf( 'stdClass', $pcache ); 96 $this->assert Equals( $id, $pcache->ID );96 $this->assertSame( $id, $pcache->ID ); 97 97 98 98 update_object_term_cache( $id, $post_type ); 99 99 $tcache = wp_cache_get( $id, 'post_tag_relationships' ); 100 100 $this->assertInternalType( 'array', $tcache ); 101 $this->assert Equals( 2, count( $tcache ) );101 $this->assertSame( 2, count( $tcache ) ); 102 102 103 103 $tcache = wp_cache_get( $id, 'ctax_relationships' ); 104 104 if ( 'cpt' === $post_type ) { 105 105 $this->assertInternalType( 'array', $tcache ); 106 $this->assert Equals( 2, count( $tcache ) );106 $this->assertSame( 2, count( $tcache ) ); 107 107 } else { 108 108 $this->assertFalse( $tcache ); … … 142 142 $out = get_post( $id ); 143 143 144 $this->assert Equals( $post['post_content'], $out->post_content );145 $this->assert Equals( $post['post_title'], $out->post_title );146 $this->assert Equals( 'future', $out->post_status );144 $this->assertSame( $post['post_content'], $out->post_content ); 145 $this->assertSame( $post['post_title'], $out->post_title ); 146 $this->assertSame( 'future', $out->post_status ); 147 147 $this->assertEquals( $post['post_author'], $out->post_author ); 148 $this->assert Equals( $post['post_date'], $out->post_date );148 $this->assertSame( $post['post_date'], $out->post_date ); 149 149 150 150 // There should be a publish_future_post hook scheduled on the future date. 151 $this->assert Equals( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );151 $this->assertSame( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 152 152 } 153 153 … … 174 174 // Fetch the post and make sure has the correct date and status. 175 175 $out = get_post( $id ); 176 $this->assert Equals( 'future', $out->post_status );177 $this->assert Equals( $post['post_date'], $out->post_date );176 $this->assertSame( 'future', $out->post_status ); 177 $this->assertSame( $post['post_date'], $out->post_date ); 178 178 179 179 // Check that there's a publish_future_post job scheduled at the right time. 180 $this->assert Equals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );180 $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 181 181 182 182 // Now save it again with a date further in the future. … … 189 189 // Fetch the post again and make sure it has the new post_date. 190 190 $out = get_post( $id ); 191 $this->assert Equals( 'future', $out->post_status );192 $this->assert Equals( $post['post_date'], $out->post_date );191 $this->assertSame( 'future', $out->post_status ); 192 $this->assertSame( $post['post_date'], $out->post_date ); 193 193 194 194 // And the correct date on the cron job. 195 $this->assert Equals( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );195 $this->assertSame( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 196 196 } 197 197 … … 219 219 // Fetch the post and make sure has the correct date and status. 220 220 $out = get_post( $id ); 221 $this->assert Equals( 'future', $out->post_status );222 $this->assert Equals( $post['post_date'], $out->post_date );221 $this->assertSame( 'future', $out->post_status ); 222 $this->assertSame( $post['post_date'], $out->post_date ); 223 223 224 224 // Check that there's a publish_future_post job scheduled at the right time. 225 $this->assert Equals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );225 $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 226 226 227 227 // Now save it again with a date further in the future. … … 234 234 // Fetch the post again and make sure it has the new post_date. 235 235 $out = get_post( $id ); 236 $this->assert Equals( 'future', $out->post_status );237 $this->assert Equals( $post['post_date'], $out->post_date );236 $this->assertSame( 'future', $out->post_status ); 237 $this->assertSame( $post['post_date'], $out->post_date ); 238 238 239 239 // And the correct date on the cron job. 240 $this->assert Equals( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );240 $this->assertSame( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 241 241 } 242 242 … … 265 265 $out = get_post( $id ); 266 266 267 $this->assert Equals( $post['post_content'], $out->post_content );268 $this->assert Equals( $post['post_title'], $out->post_title );269 $this->assert Equals( 'draft', $out->post_status );267 $this->assertSame( $post['post_content'], $out->post_content ); 268 $this->assertSame( $post['post_title'], $out->post_title ); 269 $this->assertSame( 'draft', $out->post_status ); 270 270 $this->assertEquals( $post['post_author'], $out->post_author ); 271 $this->assert Equals( $post['post_date'], $out->post_date );271 $this->assertSame( $post['post_date'], $out->post_date ); 272 272 273 273 // There should be a publish_future_post hook scheduled on the future date. 274 $this->assert Equals( false,$this->_next_schedule_for_post( 'publish_future_post', $id ) );274 $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 275 275 276 276 } … … 296 296 // Fetch the post and make sure has the correct date and status. 297 297 $out = get_post( $id ); 298 $this->assert Equals( 'future', $out->post_status );299 $this->assert Equals( $post['post_date'], $out->post_date );298 $this->assertSame( 'future', $out->post_status ); 299 $this->assertSame( $post['post_date'], $out->post_date ); 300 300 301 301 // Check that there's a publish_future_post job scheduled at the right time. 302 $this->assert Equals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );302 $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 303 303 304 304 // Now save it again with status set to draft. … … 310 310 // Fetch the post again and make sure it has the new post_date. 311 311 $out = get_post( $id ); 312 $this->assert Equals( 'draft', $out->post_status );313 $this->assert Equals( $post['post_date'], $out->post_date );312 $this->assertSame( 'draft', $out->post_status ); 313 $this->assertSame( $post['post_date'], $out->post_date ); 314 314 315 315 // And the correct date on the cron job. 316 $this->assert Equals( false,$this->_next_schedule_for_post( 'publish_future_post', $id ) );316 $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 317 317 } 318 318 … … 340 340 // Fetch the post and make sure has the correct date and status. 341 341 $out = get_post( $id ); 342 $this->assert Equals( 'future', $out->post_status );343 $this->assert Equals( $post['post_date'], $out->post_date );342 $this->assertSame( 'future', $out->post_status ); 343 $this->assertSame( $post['post_date'], $out->post_date ); 344 344 345 345 // Check that there's a publish_future_post job scheduled at the right time. 346 $this->assert Equals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );346 $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 347 347 348 348 // Now save it again with status changed. … … 354 354 // Fetch the post again and make sure it has the new post_date. 355 355 $out = get_post( $id ); 356 $this->assert Equals( $status, $out->post_status );357 $this->assert Equals( $post['post_date'], $out->post_date );356 $this->assertSame( $status, $out->post_status ); 357 $this->assertSame( $post['post_date'], $out->post_date ); 358 358 359 359 // And the correct date on the cron job. 360 $this->assert Equals( false,$this->_next_schedule_for_post( 'publish_future_post', $id ) );360 $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 361 361 } 362 362 } … … 386 386 $out = get_post( $id ); 387 387 388 $this->assert Equals( $post['post_content'], $out->post_content );389 $this->assert Equals( $post['post_title'], $out->post_title );390 $this->assert Equals( 'private', $out->post_status );388 $this->assertSame( $post['post_content'], $out->post_content ); 389 $this->assertSame( $post['post_title'], $out->post_title ); 390 $this->assertSame( 'private', $out->post_status ); 391 391 $this->assertEquals( $post['post_author'], $out->post_author ); 392 $this->assert Equals( $post['post_date'], $out->post_date );392 $this->assertSame( $post['post_date'], $out->post_date ); 393 393 394 394 // There should be a publish_future_post hook scheduled on the future date. 395 $this->assert Equals( false,$this->_next_schedule_for_post( 'publish_future_post', $id ) );395 $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 396 396 } 397 397 … … 413 413 $insert_post = wp_insert_post( $post, true ); 414 414 $this->assertWPError( $insert_post ); 415 $this->assert Equals( 'invalid_date', $insert_post->get_error_code() );415 $this->assertSame( 'invalid_date', $insert_post->get_error_code() ); 416 416 417 417 $insert_post = wp_insert_post( $post ); 418 $this->assert Equals( 0, $insert_post );418 $this->assertSame( 0, $insert_post ); 419 419 } 420 420 … … 439 439 // Fetch the post and make sure has the correct date and status. 440 440 $out = get_post( $id ); 441 $this->assert Equals( 'future', $out->post_status );442 $this->assert Equals( $post['post_date'], $out->post_date );441 $this->assertSame( 'future', $out->post_status ); 442 $this->assertSame( $post['post_date'], $out->post_date ); 443 443 444 444 // Check that there's a publish_future_post job scheduled at the right time. 445 $this->assert Equals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );445 $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 446 446 447 447 // Now save it again with status set to draft. … … 453 453 // Fetch the post again and make sure it has the new post_date. 454 454 $out = get_post( $id ); 455 $this->assert Equals( 'private', $out->post_status );456 $this->assert Equals( $post['post_date'], $out->post_date );455 $this->assertSame( 'private', $out->post_status ); 456 $this->assertSame( $post['post_date'], $out->post_date ); 457 457 458 458 // And the correct date on the cron job. 459 $this->assert Equals( false,$this->_next_schedule_for_post( 'publish_future_post', $id ) );459 $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 460 460 } 461 461 … … 479 479 $this->set_permalink_structure(); 480 480 481 $this->assert Equals( "$p-2", $post->post_name );481 $this->assertSame( "$p-2", $post->post_name ); 482 482 } 483 483 … … 519 519 ); 520 520 521 $this->assert Equals( 'world', get_post_meta( $post_id, 'hello', true ) );522 $this->assert Equals( 'bar', get_post_meta( $post_id, 'foo', true ) );521 $this->assertSame( 'world', get_post_meta( $post_id, 'hello', true ) ); 522 $this->assertSame( 'bar', get_post_meta( $post_id, 'foo', true ) ); 523 523 } 524 524 … … 544 544 545 545 // Check that there's a publish_future_post job scheduled at the right time. 546 $this->assert Equals( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );546 $this->assertSame( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) ); 547 547 548 548 // Now delete the post and make sure the cron entry is removed. … … 577 577 578 578 // Permalink should include the post ID at the end. 579 $this->assert Equals( get_option( 'siteurl' ) . '/2007/10/31/' . $id . '/', $plink );579 $this->assertSame( get_option( 'siteurl' ) . '/2007/10/31/' . $id . '/', $plink ); 580 580 } 581 581 … … 584 584 585 585 $post = get_post( $draft_id ); 586 $this->assert Equals( 'draft', $post->post_status );586 $this->assertSame( 'draft', $post->post_status ); 587 587 588 588 wp_publish_post( $draft_id ); 589 589 $post = get_post( $draft_id ); 590 590 591 $this->assert Equals( 'publish', $post->post_status );591 $this->assertSame( 'publish', $post->post_status ); 592 592 } 593 593 … … 605 605 606 606 $post = get_post( $post_id ); 607 $this->assert Equals( 'future', $post->post_status );608 $this->assert Equals( $future_date, $post->post_date );607 $this->assertSame( 'future', $post->post_status ); 608 $this->assertSame( $future_date, $post->post_date ); 609 609 610 610 wp_publish_post( $post_id ); 611 611 $post = get_post( $post_id ); 612 612 613 $this->assert Equals( 'publish', $post->post_status );614 $this->assert Equals( $future_date, $post->post_date );613 $this->assertSame( 'publish', $post->post_status ); 614 $this->assertSame( $future_date, $post->post_date ); 615 615 } 616 616 … … 627 627 628 628 $post = get_post( $post_id ); 629 $this->assert Equals( 'publish', $post->post_status );630 $this->assert Equals( $future_date, $post->post_date );629 $this->assertSame( 'publish', $post->post_status ); 630 $this->assertSame( $future_date, $post->post_date ); 631 631 } 632 632 … … 639 639 $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) ); 640 640 $post = get_post( $post_id ); 641 $this->assert Equals( '<script>Test</script>', $post->post_title );642 $this->assert Equals( 'draft', $post->post_status );641 $this->assertSame( '<script>Test</script>', $post->post_title ); 642 $this->assertSame( 'draft', $post->post_status ); 643 643 644 644 kses_init_filters(); … … 651 651 ); 652 652 $post = get_post( $post->ID ); 653 $this->assert Equals( 'Test', $post->post_title );653 $this->assertSame( 'Test', $post->post_title ); 654 654 655 655 kses_remove_filters(); … … 664 664 $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) ); 665 665 $post = get_post( $post_id ); 666 $this->assert Equals( '<script>Test</script>', $post->post_title );667 $this->assert Equals( 'draft', $post->post_status );666 $this->assertSame( '<script>Test</script>', $post->post_title ); 667 $this->assertSame( 'draft', $post->post_status ); 668 668 669 669 kses_init_filters(); … … 671 671 wp_publish_post( $post->ID ); 672 672 $post = get_post( $post->ID ); 673 $this->assert Equals( '<script>Test</script>', $post->post_title );673 $this->assertSame( '<script>Test</script>', $post->post_title ); 674 674 675 675 kses_remove_filters(); … … 683 683 $parent_id = self::factory()->post->create(); 684 684 $post = self::factory()->post->create_and_get( array( 'post_parent' => $parent_id ) ); 685 $this->assert Equals( array( $parent_id ), get_post_ancestors( 0 ) );685 $this->assertSame( array( $parent_id ), get_post_ancestors( 0 ) ); 686 686 } 687 687 … … 695 695 $post['ID'] = 123456789; 696 696 697 $this->assert Equals( 0, wp_insert_post( $post ) );698 $this->assert Equals( 0, wp_update_post( $post ) );697 $this->assertSame( 0, wp_insert_post( $post ) ); 698 $this->assertSame( 0, wp_update_post( $post ) ); 699 699 700 700 $this->assertInstanceOf( 'WP_Error', wp_insert_post( $post, true ) ); … … 708 708 $post = get_post( $post_id ); 709 709 setup_postdata( $post ); 710 $this->assert Equals( 0, $multipage );710 $this->assertSame( 0, $multipage ); 711 711 $this->assertCount( 1, $pages ); 712 $this->assert Equals( 1, $numpages );713 $this->assert Equals( array( 'Page 0' ), $pages );712 $this->assertSame( 1, $numpages ); 713 $this->assertSame( array( 'Page 0' ), $pages ); 714 714 } 715 715 … … 719 719 $post = get_post( $post_id ); 720 720 setup_postdata( $post ); 721 $this->assert Equals( 1, $multipage );721 $this->assertSame( 1, $multipage ); 722 722 $this->assertCount( 4, $pages ); 723 $this->assert Equals( 4, $numpages );724 $this->assert Equals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );723 $this->assertSame( 4, $numpages ); 724 $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages ); 725 725 } 726 726 … … 730 730 $post = get_post( $post_id ); 731 731 setup_postdata( $post ); 732 $this->assert Equals( 0, $multipage );732 $this->assertSame( 0, $multipage ); 733 733 $this->assertCount( 1, $pages ); 734 $this->assert Equals( 1, $numpages );735 $this->assert Equals( array( 'Page 0' ), $pages );734 $this->assertSame( 1, $numpages ); 735 $this->assertSame( array( 'Page 0' ), $pages ); 736 736 } 737 737 … … 741 741 $post = get_post( $post_id ); 742 742 setup_postdata( $post ); 743 $this->assert Equals( 1, $multipage );743 $this->assertSame( 1, $multipage ); 744 744 $this->assertCount( 4, $pages ); 745 $this->assert Equals( 4, $numpages );746 $this->assert Equals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );745 $this->assertSame( 4, $numpages ); 746 $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages ); 747 747 } 748 748 … … 755 755 $post = get_post( $post_id ); 756 756 setup_postdata( $post ); 757 $this->assert Equals( 1, $multipage );757 $this->assertSame( 1, $multipage ); 758 758 $this->assertCount( 4, $pages ); 759 $this->assert Equals( 4, $numpages );760 $this->assert Equals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );759 $this->assertSame( 4, $numpages ); 760 $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages ); 761 761 } 762 762 … … 769 769 $post = get_post( $post_id ); 770 770 setup_postdata( $post ); 771 $this->assert Equals( 0, $multipage );771 $this->assertSame( 0, $multipage ); 772 772 $this->assertCount( 1, $pages ); 773 $this->assert Equals( 1, $numpages );774 $this->assert Equals( array( 'Page 0' ), $pages );773 $this->assertSame( 1, $numpages ); 774 $this->assertSame( array( 'Page 0' ), $pages ); 775 775 } 776 776 … … 798 798 $post = get_post( $insert_post_id ); 799 799 $this->assertEquals( $post->post_author, self::$editor_id ); 800 $this->assert Equals( $post->post_title, $title );800 $this->assertSame( $post->post_title, $title ); 801 801 } 802 802 … … 853 853 wp_insert_post( $_post ); 854 854 $post = get_post( $post_ids[ $key ] ); 855 $this->assert Equals( 'draft', $post->post_status );855 $this->assertSame( 'draft', $post->post_status ); 856 856 $this->assertNotEquals( 'publish', $post->post_status ); 857 857 … … 871 871 872 872 $post = get_post( $post_ids[ $key ] ); 873 $this->assert Equals( 'trash', $post->post_status );873 $this->assertSame( 'trash', $post->post_status ); 874 874 $this->assertNotEquals( 'publish', $post->post_status ); 875 875 … … 893 893 $counts = wp_count_posts(); 894 894 $this->assertTrue( isset( $counts->test ) ); 895 $this->assert Equals( 0, $counts->test );895 $this->assertSame( 0, $counts->test ); 896 896 } 897 897 … … 961 961 962 962 foreach ( $expected as $field => $value ) { 963 $this->assert Equals( $value, $post->$field );963 $this->assertSame( $value, $post->$field ); 964 964 } 965 965 } … … 979 979 $post = get_post( $post_id ); 980 980 981 $this->assert Equals( 'open', $post->comment_status );982 $this->assert Equals( 'open', $post->ping_status );981 $this->assertSame( 'open', $post->comment_status ); 982 $this->assertSame( 'open', $post->ping_status ); 983 983 } 984 984 … … 998 998 $post = get_post( $post_id ); 999 999 1000 $this->assert Equals( 'closed', $post->comment_status );1001 $this->assert Equals( 'closed', $post->ping_status );1000 $this->assertSame( 'closed', $post->comment_status ); 1001 $this->assertSame( 'closed', $post->ping_status ); 1002 1002 } 1003 1003 … … 1019 1019 $post = get_post( $post_id ); 1020 1020 1021 $this->assert Equals( 'open', $post->comment_status );1022 $this->assert Equals( 'open', $post->ping_status );1021 $this->assertSame( 'open', $post->comment_status ); 1022 $this->assertSame( 'open', $post->ping_status ); 1023 1023 _unregister_post_type( $post_type ); 1024 1024 } … … 1041 1041 $post = get_post( $post_id ); 1042 1042 1043 $this->assert Equals( 'closed', $post->comment_status );1044 $this->assert Equals( 'closed', $post->ping_status );1043 $this->assertSame( 'closed', $post->comment_status ); 1044 $this->assertSame( 'closed', $post->ping_status ); 1045 1045 _unregister_post_type( $post_type ); 1046 1046 } … … 1080 1080 $saved_post = get_post( $post->ID ); 1081 1081 $this->assertTrue( is_sticky( $saved_post->ID ) ); 1082 $this->assert Equals( 'Updated', $saved_post->post_title );1083 $this->assert Equals( 'Updated', $saved_post->post_content );1082 $this->assertSame( 'Updated', $saved_post->post_title ); 1083 $this->assertSame( 'Updated', $saved_post->post_content ); 1084 1084 } 1085 1085 … … 1121 1121 $saved_post = get_post( $post->ID ); 1122 1122 $this->assertTrue( is_sticky( $saved_post->ID ) ); 1123 $this->assert Equals( 'Updated', $saved_post->post_title );1124 $this->assert Equals( 'Updated', $saved_post->post_content );1123 $this->assertSame( 'Updated', $saved_post->post_title ); 1124 $this->assertSame( 'Updated', $saved_post->post_content ); 1125 1125 } 1126 1126 … … 1148 1148 remove_action( 'post_unstuck', array( $a2, 'action' ) ); 1149 1149 1150 $this->assert Equals( 1, $a1->get_call_count() );1151 $this->assert Equals( 1, $a2->get_call_count() );1150 $this->assertSame( 1, $a1->get_call_count() ); 1151 $this->assertSame( 1, $a2->get_call_count() ); 1152 1152 } 1153 1153 … … 1175 1175 $updated_post = get_post( $post_id ); 1176 1176 // Ensure changing the post_title didn't modify the post_name. 1177 $this->assert Equals( 'stuff', $updated_post->post_name );1177 $this->assertSame( 'stuff', $updated_post->post_name ); 1178 1178 } 1179 1179 … … 1213 1213 $out = get_post( $id ); 1214 1214 1215 $this->assert Equals( $post['post_content'], $out->post_content );1216 $this->assert Equals( $post['post_title'], $out->post_title );1215 $this->assertSame( $post['post_content'], $out->post_content ); 1216 $this->assertSame( $post['post_title'], $out->post_title ); 1217 1217 $this->assertEquals( $post['post_author'], $out->post_author ); 1218 $this->assert Equals( get_date_from_gmt( $post['post_date_gmt'] ), $out->post_date );1219 $this->assert Equals( $post['post_date_gmt'], $out->post_date_gmt );1218 $this->assertSame( get_date_from_gmt( $post['post_date_gmt'] ), $out->post_date ); 1219 $this->assertSame( $post['post_date_gmt'], $out->post_date_gmt ); 1220 1220 } 1221 1221 … … 1234 1234 ) 1235 1235 ); 1236 $this->assert Equals( $parent_page_id, get_post( $page_id )->post_parent );1236 $this->assertSame( $parent_page_id, get_post( $page_id )->post_parent ); 1237 1237 wp_delete_post( $parent_page_id, true ); 1238 $this->assert Equals( $grandparent_page_id, get_post( $page_id )->post_parent );1238 $this->assertSame( $grandparent_page_id, get_post( $page_id )->post_parent ); 1239 1239 wp_delete_post( $grandparent_page_id, true ); 1240 $this->assert Equals( 0, get_post( $page_id )->post_parent );1240 $this->assertSame( 0, get_post( $page_id )->post_parent ); 1241 1241 } 1242 1242 … … 1249 1249 function test_wp_insert_post_for_customize_changeset_should_not_drop_post_name() { 1250 1250 1251 $this->assert Equals( 10, has_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data' ) );1251 $this->assertSame( 10, has_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data' ) ); 1252 1252 1253 1253 $changeset_data = array( … … 1267 1267 ) 1268 1268 ); 1269 $this->assert Equals( $uuid, get_post( $post_id )->post_name, 'Expected lower-case UUID4 to be inserted.' );1270 $this->assert Equals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );1269 $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected lower-case UUID4 to be inserted.' ); 1270 $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) ); 1271 1271 1272 1272 $changeset_data['blogname']['value'] = 'Hola Mundo'; … … 1278 1278 ) 1279 1279 ); 1280 $this->assert Equals( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for drafts.' );1281 $this->assert Equals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );1280 $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for drafts.' ); 1281 $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) ); 1282 1282 1283 1283 $changeset_data['blogname']['value'] = 'Hallo Welt'; … … 1289 1289 ) 1290 1290 ); 1291 $this->assert Equals( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for pending.' );1292 $this->assert Equals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );1291 $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for pending.' ); 1292 $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) ); 1293 1293 } 1294 1294 … … 1311 1311 ); 1312 1312 $post = get_post( $post_id ); 1313 $this->assert Equals( 'override-slug-' . $post->post_type, $post->post_name );1313 $this->assertSame( 'override-slug-' . $post->post_type, $post->post_name ); 1314 1314 1315 1315 remove_filter( 'pre_wp_unique_post_slug', array( $this, 'filter_pre_wp_unique_post_slug' ), 10, 6 ); … … 1335 1335 1336 1336 $post = get_post( $post_id ); 1337 self::assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1337 self::assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1338 1338 } 1339 1339
Note: See TracChangeset
for help on using the changeset viewer.