Changeset 48937 for trunk/tests/phpunit/tests/general/document-title.php
- Timestamp:
- 09/02/2020 12:35:36 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/document-title.php
r46586 r48937 81 81 add_filter( 'pre_get_document_title', array( $this, '_short_circuit_title' ) ); 82 82 83 $this->assert Equals( 'A Wild Title', wp_get_document_title() );83 $this->assertSame( 'A Wild Title', wp_get_document_title() ); 84 84 } 85 85 … … 102 102 103 103 $this->go_to( '/' ); 104 $this->assert Equals( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );104 $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); 105 105 106 106 update_option( 'show_on_front', 'posts' ); 107 107 108 108 $this->go_to( '/' ); 109 $this->assert Equals( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );109 $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); 110 110 } 111 111 … … 130 130 // Show page name on home page if it's not the front page. 131 131 $this->go_to( get_permalink( $blog_page_id ) ); 132 $this->assert Equals( sprintf( 'blog-page – %s', $this->blog_name ), wp_get_document_title() );132 $this->assertSame( sprintf( 'blog-page – %s', $this->blog_name ), wp_get_document_title() ); 133 133 } 134 134 … … 138 138 add_filter( 'document_title_parts', array( $this, '_paged_title_parts' ) ); 139 139 140 $this->assert Equals( sprintf( '%s – Page 4 – Just another WordPress site', $this->blog_name ), wp_get_document_title() );140 $this->assertSame( sprintf( '%s – Page 4 – Just another WordPress site', $this->blog_name ), wp_get_document_title() ); 141 141 } 142 142 … … 155 155 add_filter( 'document_title_parts', array( $this, '_singular_title_parts' ) ); 156 156 157 $this->assert Equals( sprintf( 'test_title – %s', $this->blog_name ), wp_get_document_title() );157 $this->assertSame( sprintf( 'test_title – %s', $this->blog_name ), wp_get_document_title() ); 158 158 } 159 159 … … 169 169 $this->go_to( '?cat=' . self::$category_id ); 170 170 171 $this->assert Equals( sprintf( 'test_category – %s', $this->blog_name ), wp_get_document_title() );171 $this->assertSame( sprintf( 'test_category – %s', $this->blog_name ), wp_get_document_title() ); 172 172 } 173 173 … … 175 175 $this->go_to( '?s=test_title' ); 176 176 177 $this->assert Equals( sprintf( 'Search Results for “test_title” – %s', $this->blog_name ), wp_get_document_title() );177 $this->assertSame( sprintf( 'Search Results for “test_title” – %s', $this->blog_name ), wp_get_document_title() ); 178 178 } 179 179 … … 181 181 $this->go_to( '?author=' . self::$author_id ); 182 182 183 $this->assert Equals( sprintf( 'test_author – %s', $this->blog_name ), wp_get_document_title() );183 $this->assertSame( sprintf( 'test_author – %s', $this->blog_name ), wp_get_document_title() ); 184 184 } 185 185 … … 204 204 $this->go_to( '?post_type=cpt' ); 205 205 206 $this->assert Equals( sprintf( 'test_cpt – %s', $this->blog_name ), wp_get_document_title() );206 $this->assertSame( sprintf( 'test_cpt – %s', $this->blog_name ), wp_get_document_title() ); 207 207 } 208 208 … … 210 210 $this->go_to( '?year=2015' ); 211 211 212 $this->assert Equals( sprintf( '2015 – %s', $this->blog_name ), wp_get_document_title() );212 $this->assertSame( sprintf( '2015 – %s', $this->blog_name ), wp_get_document_title() ); 213 213 } 214 214 … … 216 216 $this->go_to( '?monthnum=09' ); 217 217 218 $this->assert Equals( sprintf( 'September 2015 – %s', $this->blog_name ), wp_get_document_title() );218 $this->assertSame( sprintf( 'September 2015 – %s', $this->blog_name ), wp_get_document_title() ); 219 219 } 220 220 … … 222 222 $this->go_to( '?day=22' ); 223 223 224 $this->assert Equals( sprintf( 'September 22, 2015 – %s', $this->blog_name ), wp_get_document_title() );224 $this->assertSame( sprintf( 'September 22, 2015 – %s', $this->blog_name ), wp_get_document_title() ); 225 225 } 226 226 … … 228 228 $this->go_to( '?m=404' ); 229 229 230 $this->assert Equals( sprintf( 'Page not found – %s', $this->blog_name ), wp_get_document_title() );230 $this->assertSame( sprintf( 'Page not found – %s', $this->blog_name ), wp_get_document_title() ); 231 231 } 232 232 … … 236 236 add_filter( 'title_tag_parts', array( $this, '_paged_post_title_parts' ) ); 237 237 238 $this->assert Equals( sprintf( 'test_title – Page 4 – %s', $this->blog_name ), wp_get_document_title() );238 $this->assertSame( sprintf( 'test_title – Page 4 – %s', $this->blog_name ), wp_get_document_title() ); 239 239 } 240 240 … … 253 253 add_filter( 'document_title_parts', array( $this, '_rearrange_title_parts' ) ); 254 254 255 $this->assert Equals( sprintf( '%s – test_title', $this->blog_name ), wp_get_document_title() );255 $this->assertSame( sprintf( '%s – test_title', $this->blog_name ), wp_get_document_title() ); 256 256 } 257 257 … … 270 270 add_filter( 'document_title_separator', array( $this, '_change_title_separator' ) ); 271 271 272 $this->assert Equals( sprintf( 'test_title %%%% %s', $this->blog_name ), wp_get_document_title() );272 $this->assertSame( sprintf( 'test_title %%%% %s', $this->blog_name ), wp_get_document_title() ); 273 273 } 274 274
Note: See TracChangeset
for help on using the changeset viewer.