Changeset 48937 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 09/02/2020 12:35:36 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesPost.php
r48117 r48937 38 38 $_results = _wp_translate_postdata( false, $_post_data ); 39 39 $this->assertNotWPError( $_results ); 40 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );41 $this->assert Equals( 'draft', $_results['post_status'] );40 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 41 $this->assertSame( 'draft', $_results['post_status'] ); 42 42 43 43 // Submit post for approval. … … 49 49 $_results = _wp_translate_postdata( false, $_post_data ); 50 50 $this->assertNotWPError( $_results ); 51 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );52 $this->assert Equals( 'pending', $_results['post_status'] );51 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 52 $this->assertSame( 'pending', $_results['post_status'] ); 53 53 54 54 // Create new draft post for another user. … … 60 60 $_results = _wp_translate_postdata( false, $_post_data ); 61 61 $this->assertInstanceOf( 'WP_Error', $_results ); 62 $this->assert Equals( 'edit_others_posts', $_results->get_error_code() );63 $this->assert Equals( 'Sorry, you are not allowed to create posts as this user.', $_results->get_error_message() );62 $this->assertSame( 'edit_others_posts', $_results->get_error_code() ); 63 $this->assertSame( 'Sorry, you are not allowed to create posts as this user.', $_results->get_error_message() ); 64 64 65 65 // Edit draft post for another user. … … 73 73 $_results = _wp_translate_postdata( true, $_post_data ); 74 74 $this->assertInstanceOf( 'WP_Error', $_results ); 75 $this->assert Equals( 'edit_others_posts', $_results->get_error_code() );76 $this->assert Equals( 'Sorry, you are not allowed to edit posts as this user.', $_results->get_error_message() );75 $this->assertSame( 'edit_others_posts', $_results->get_error_code() ); 76 $this->assertSame( 'Sorry, you are not allowed to edit posts as this user.', $_results->get_error_message() ); 77 77 } 78 78 … … 88 88 $_results = _wp_translate_postdata( false, $_post_data ); 89 89 $this->assertNotWPError( $_results ); 90 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );91 $this->assert Equals( 'draft', $_results['post_status'] );90 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 91 $this->assertSame( 'draft', $_results['post_status'] ); 92 92 93 93 // Publish post. … … 99 99 $_results = _wp_translate_postdata( false, $_post_data ); 100 100 $this->assertNotWPError( $_results ); 101 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );102 $this->assert Equals( 'publish', $_results['post_status'] );101 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 102 $this->assertSame( 'publish', $_results['post_status'] ); 103 103 104 104 // Create new draft post for another user. … … 110 110 $_results = _wp_translate_postdata( false, $_post_data ); 111 111 $this->assertNotWPError( $_results ); 112 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );113 $this->assert Equals( 'draft', $_results['post_status'] );112 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 113 $this->assertSame( 'draft', $_results['post_status'] ); 114 114 115 115 // Edit draft post for another user. … … 123 123 $_results = _wp_translate_postdata( true, $_post_data ); 124 124 $this->assertNotWPError( $_results ); 125 $this->assert Equals( $_post_data['post_author'], $_results['post_author'] );126 $this->assert Equals( 'draft', $_results['post_status'] );125 $this->assertSame( $_post_data['post_author'], $_results['post_author'] ); 126 $this->assertSame( 'draft', $_results['post_status'] ); 127 127 } 128 128 … … 135 135 wp_set_current_user( self::$editor_id ); 136 136 $post = self::factory()->post->create_and_get( array( 'post_status' => 'auto-draft' ) ); 137 $this->assert Equals( 'auto-draft', $post->post_status );137 $this->assertSame( 'auto-draft', $post->post_status ); 138 138 $post_data = array( 139 139 'post_title' => 'Post title', … … 143 143 ); 144 144 edit_post( $post_data ); 145 $this->assert Equals( 'draft', get_post( $post->ID )->post_status );145 $this->assertSame( 'draft', get_post( $post->ID )->post_status ); 146 146 } 147 147 … … 253 253 254 254 // Check that the first post's values don't stomp the second post. 255 $this->assert Equals( 'draft', $post->post_status );255 $this->assertSame( 'draft', $post->post_status ); 256 256 $this->assertEquals( self::$author_ids[1], $post->post_author ); 257 $this->assert Equals( 'closed', $post->comment_status );258 $this->assert Equals( 'closed', $post->ping_status );257 $this->assertSame( 'closed', $post->comment_status ); 258 $this->assertSame( 'closed', $post->ping_status ); 259 259 } 260 260 … … 315 315 public function check_post_format( $post_id ) { 316 316 if ( self::$post_id === $post_id ) { 317 $this->assert Equals( 'aside', get_post_format( $post_id ) );317 $this->assertSame( 'aside', get_post_format( $post_id ) ); 318 318 } 319 319 } … … 539 539 540 540 $found = get_sample_permalink( $p ); 541 $this->assert Equals( '2015-2', $found[1] );541 $this->assertSame( '2015-2', $found[1] ); 542 542 } 543 543 … … 555 555 556 556 $found = get_sample_permalink( $p ); 557 $this->assert Equals( '2015', $found[1] );557 $this->assertSame( '2015', $found[1] ); 558 558 } 559 559 … … 571 571 572 572 $found = get_sample_permalink( $p ); 573 $this->assert Equals( '11-2', $found[1] );573 $this->assertSame( '11-2', $found[1] ); 574 574 } 575 575 … … 587 587 588 588 $found = get_sample_permalink( $p ); 589 $this->assert Equals( '13', $found[1] );589 $this->assertSame( '13', $found[1] ); 590 590 } 591 591 … … 603 603 604 604 $found = get_sample_permalink( $p ); 605 $this->assert Equals( '30-2', $found[1] );605 $this->assertSame( '30-2', $found[1] ); 606 606 } 607 607 … … 625 625 626 626 $found = get_sample_permalink( $p ); 627 $this->assert Equals( '30-3', $found[1] );627 $this->assertSame( '30-3', $found[1] ); 628 628 } 629 629 … … 641 641 642 642 $found = get_sample_permalink( $p ); 643 $this->assert Equals( '32', $found[1] );643 $this->assertSame( '32', $found[1] ); 644 644 } 645 645 … … 657 657 658 658 $found = get_sample_permalink( $p ); 659 $this->assert Equals( '30', $found[1] );659 $this->assertSame( '30', $found[1] ); 660 660 } 661 661 … … 826 826 $name = 'core/test'; 827 827 $settings = array( 828 'icon' => 'text', 828 829 'category' => 'common', 829 'icon' => 'text',830 830 'render_callback' => 'foo', 831 831 ); … … 838 838 839 839 $this->assertArrayHasKey( $name, $blocks ); 840 $this->assert Equals(840 $this->assertSame( 841 841 array( 842 842 'title' => '', 843 843 'description' => '', 844 'icon' => 'text', 844 845 'category' => 'common', 845 'icon' => 'text',846 846 'keywords' => array(), 847 847 'usesContext' => array(), … … 866 866 867 867 $this->assertNotFalse( add_meta( $p ) ); 868 $this->assert Equals( '', get_post_meta( $p, 'testkey', true ) );868 $this->assertSame( '', get_post_meta( $p, 'testkey', true ) ); 869 869 } 870 870
Note: See TracChangeset
for help on using the changeset viewer.