Changeset 48937 for trunk/tests/phpunit/tests/post/formats.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/formats.php
r47122 r48937 18 18 $this->assertNotWPError( $result ); 19 19 $this->assertInternalType( 'array', $result ); 20 $this->assert Equals( 1, count( $result ) );20 $this->assertSame( 1, count( $result ) ); 21 21 22 22 $format = get_post_format( $post_id ); 23 $this->assert Equals( 'aside', $format );23 $this->assertSame( 'aside', $format ); 24 24 25 25 $result = set_post_format( $post_id, 'standard' ); 26 26 $this->assertNotWPError( $result ); 27 27 $this->assertInternalType( 'array', $result ); 28 $this->assert Equals( 0, count( $result ) );28 $this->assertSame( 0, count( $result ) ); 29 29 30 30 $result = set_post_format( $post_id, '' ); 31 31 $this->assertNotWPError( $result ); 32 32 $this->assertInternalType( 'array', $result ); 33 $this->assert Equals( 0, count( $result ) );33 $this->assertSame( 0, count( $result ) ); 34 34 } 35 35 … … 46 46 $this->assertNotWPError( $result ); 47 47 $this->assertInternalType( 'array', $result ); 48 $this->assert Equals( 1, count( $result ) );48 $this->assertSame( 1, count( $result ) ); 49 49 // The format can be set but not retrieved until it is registered. 50 50 $format = get_post_format( $post_id ); … … 54 54 // The previous set can now be retrieved. 55 55 $format = get_post_format( $post_id ); 56 $this->assert Equals( 'aside', $format );56 $this->assertSame( 'aside', $format ); 57 57 58 58 $result = set_post_format( $post_id, 'standard' ); 59 59 $this->assertNotWPError( $result ); 60 60 $this->assertInternalType( 'array', $result ); 61 $this->assert Equals( 0, count( $result ) );61 $this->assertSame( 0, count( $result ) ); 62 62 63 63 $result = set_post_format( $post_id, '' ); 64 64 $this->assertNotWPError( $result ); 65 65 $this->assertInternalType( 'array', $result ); 66 $this->assert Equals( 0, count( $result ) );66 $this->assertSame( 0, count( $result ) ); 67 67 68 68 remove_post_type_support( 'page', 'post-formats' ); … … 78 78 $this->assertNotWPError( $result ); 79 79 $this->assertInternalType( 'array', $result ); 80 $this->assert Equals( 1, count( $result ) );80 $this->assertSame( 1, count( $result ) ); 81 81 $this->assertTrue( has_post_format( 'aside', $post_id ) ); 82 82 … … 84 84 $this->assertNotWPError( $result ); 85 85 $this->assertInternalType( 'array', $result ); 86 $this->assert Equals( 0, count( $result ) );86 $this->assertSame( 0, count( $result ) ); 87 87 // Standard is a special case. It shows as false when set. 88 88 $this->assertFalse( has_post_format( 'standard', $post_id ) ); … … 114 114 $link_post_id = self::factory()->post->create( array( 'post_content' => $link ) ); 115 115 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) ); 116 $this->assert Equals( false,$content_link );116 $this->assertFalse( $content_link ); 117 117 118 118 $link_with_post_id = self::factory()->post->create( array( 'post_content' => $link_with_commentary ) ); 119 119 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) ); 120 $this->assert Equals( false,$content_link );120 $this->assertFalse( $content_link ); 121 121 122 122 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) ); 123 $this->assert Equals( false,$content_link );123 $this->assertFalse( $content_link ); 124 124 125 125 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) ); 126 $this->assert Equals( false,$content_link );126 $this->assertFalse( $content_link ); 127 127 128 128 $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) ); 129 129 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 130 $this->assert Equals( false,$content_link );130 $this->assertFalse( $content_link ); 131 131 132 132 $comm_post_id = self::factory()->post->create( array( 'post_content' => $commentary ) ); 133 133 $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) ); 134 $this->assert Equals( false,$content_link );134 $this->assertFalse( $content_link ); 135 135 136 136 // Now with an href. 137 137 $href_post_id = self::factory()->post->create( array( 'post_content' => $href ) ); 138 138 $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) ); 139 $this->assert Equals( $link, $content_link );139 $this->assertSame( $link, $content_link ); 140 140 141 141 $href_with_post_id = self::factory()->post->create( array( 'post_content' => $href_with_commentary ) ); 142 142 $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) ); 143 $this->assert Equals( $link, $content_link );143 $this->assertSame( $link, $content_link ); 144 144 145 145 $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) ); 146 $this->assert Equals( $link, $content_link );146 $this->assertSame( $link, $content_link ); 147 147 148 148 $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) ); 149 $this->assert Equals( $link, $content_link );149 $this->assertSame( $link, $content_link ); 150 150 151 151 $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) ); 152 152 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 153 $this->assert Equals( false,$content_link );153 $this->assertFalse( $content_link ); 154 154 155 155 $comm_post_id = self::factory()->post->create( array( 'post_content' => $commentary ) ); 156 156 $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) ); 157 $this->assert Equals( false,$content_link );157 $this->assertFalse( $content_link ); 158 158 } 159 159 }
Note: See TracChangeset
for help on using the changeset viewer.