Changeset 43571 for trunk/tests/phpunit/tests/template.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/template.php
r42343 r43571 51 51 parent::setUp(); 52 52 register_post_type( 53 'cpt', array( 53 'cpt', 54 array( 54 55 'public' => true, 55 56 ) 56 57 ); 57 58 register_taxonomy( 58 'taxo', 'post', array( 59 'taxo', 60 'post', 61 array( 59 62 'public' => true, 60 63 'hierarchical' => true, … … 76 79 array( 77 80 'p' => '-1', 78 ), home_url() 79 ); 80 81 $this->assertTemplateHierarchy( 82 $url, array( 81 ), 82 home_url() 83 ); 84 85 $this->assertTemplateHierarchy( 86 $url, 87 array( 83 88 '404.php', 84 89 ) … … 94 99 95 100 $this->assertTemplateHierarchy( 96 get_author_posts_url( $author->ID ), array( 101 get_author_posts_url( $author->ID ), 102 array( 97 103 'author-foo.php', 98 104 "author-{$author->ID}.php", … … 112 118 113 119 $this->assertTemplateHierarchy( 114 get_term_link( $term ), array( 120 get_term_link( $term ), 121 array( 115 122 'category-foo-😀.php', 116 123 'category-foo-%f0%9f%98%80.php', … … 131 138 132 139 $this->assertTemplateHierarchy( 133 get_term_link( $term ), array( 140 get_term_link( $term ), 141 array( 134 142 'tag-foo-😀.php', 135 143 'tag-foo-%f0%9f%98%80.php', … … 150 158 151 159 $this->assertTemplateHierarchy( 152 get_term_link( $term ), array( 160 get_term_link( $term ), 161 array( 153 162 'taxonomy-taxo-foo-😀.php', 154 163 'taxonomy-taxo-foo-%f0%9f%98%80.php', … … 162 171 public function test_date_template_hierarchy_for_year() { 163 172 $this->assertTemplateHierarchy( 164 get_year_link( 1984 ), array( 173 get_year_link( 1984 ), 174 array( 165 175 'date.php', 166 176 'archive.php', … … 171 181 public function test_date_template_hierarchy_for_month() { 172 182 $this->assertTemplateHierarchy( 173 get_month_link( 1984, 2 ), array( 183 get_month_link( 1984, 2 ), 184 array( 174 185 'date.php', 175 186 'archive.php', … … 180 191 public function test_date_template_hierarchy_for_day() { 181 192 $this->assertTemplateHierarchy( 182 get_day_link( 1984, 2, 25 ), array( 193 get_day_link( 1984, 2, 25 ), 194 array( 183 195 'date.php', 184 196 'archive.php', … … 191 203 array( 192 204 's' => 'foo', 193 ), home_url() 194 ); 195 196 $this->assertTemplateHierarchy( 197 $url, array( 205 ), 206 home_url() 207 ); 208 209 $this->assertTemplateHierarchy( 210 $url, 211 array( 198 212 'search.php', 199 213 ) … … 204 218 $this->assertEquals( 'posts', get_option( 'show_on_front' ) ); 205 219 $this->assertTemplateHierarchy( 206 home_url(), array( 220 home_url(), 221 array( 207 222 'front-page.php', 208 223 'home.php', … … 218 233 219 234 $this->assertTemplateHierarchy( 220 home_url(), array( 235 home_url(), 236 array( 221 237 'front-page.php', 222 238 'page-page-on-front-😀.php', … … 235 251 236 252 $this->assertTemplateHierarchy( 237 get_permalink( self::$page_for_posts ), array( 253 get_permalink( self::$page_for_posts ), 254 array( 238 255 'home.php', 239 256 'index.php', … … 244 261 public function test_page_template_hierarchy() { 245 262 $this->assertTemplateHierarchy( 246 get_permalink( self::$page ), array( 263 get_permalink( self::$page ), 264 array( 247 265 'templates/page.php', 248 266 'page-page-name-😀.php', … … 260 278 public function test_single_template_hierarchy_for_post() { 261 279 $this->assertTemplateHierarchy( 262 get_permalink( self::$post ), array( 280 get_permalink( self::$post ), 281 array( 263 282 'templates/post.php', 264 283 'single-post-post-name-😀.php', … … 280 299 281 300 $this->assertTemplateHierarchy( 282 get_permalink( $cpt ), array( 301 get_permalink( $cpt ), 302 array( 283 303 'single-cpt-cpt-name-😀.php', 284 304 'single-cpt-cpt-name-%f0%9f%98%80.php', … … 303 323 304 324 $this->assertTemplateHierarchy( 305 get_permalink( $cpt ), array( 325 get_permalink( $cpt ), 326 array( 306 327 'templates/cpt.php', 307 328 'single-cpt-cpt-name-😀.php', … … 323 344 ); 324 345 $this->assertTemplateHierarchy( 325 get_permalink( $attachment ), array( 346 get_permalink( $attachment ), 347 array( 326 348 'image-jpeg.php', 327 349 'jpeg.php', … … 352 374 353 375 $this->assertTemplateHierarchy( 354 get_permalink( $attachment ), array( 376 get_permalink( $attachment ), 377 array( 355 378 'image-jpeg.php', 356 379 'jpeg.php', … … 368 391 public function test_embed_template_hierarchy_for_post() { 369 392 $this->assertTemplateHierarchy( 370 get_post_embed_url( self::$post ), array( 393 get_post_embed_url( self::$post ), 394 array( 371 395 'embed-post-quote.php', 372 396 'embed-post.php', … … 384 408 public function test_embed_template_hierarchy_for_page() { 385 409 $this->assertTemplateHierarchy( 386 get_post_embed_url( self::$page ), array( 410 get_post_embed_url( self::$page ), 411 array( 387 412 'embed-page.php', 388 413 'embed.php',
Note: See TracChangeset
for help on using the changeset viewer.