Changeset 38951 for trunk/tests/phpunit/tests/template.php
- Timestamp:
- 10/26/2016 08:06:43 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/template.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/template.php
r38583 r38951 37 37 ) ); 38 38 set_post_format( self::$post, 'quote' ); 39 add_post_meta( self::$post->ID, '_wp_page_template', 'templates/post.php' ); 39 40 } 40 41 … … 204 205 } 205 206 207 /** 208 * @ticket 18375 209 */ 206 210 public function test_single_template_hierarchy_for_post() { 207 211 $this->assertTemplateHierarchy( get_permalink( self::$post ), array( 212 'templates/post.php', 208 213 'single-post-post-name-😀.php', 209 214 'single-post-post-name-%f0%9f%98%80.php', … … 221 226 222 227 $this->assertTemplateHierarchy( get_permalink( $cpt ), array( 228 'single-cpt-cpt-name-😀.php', 229 'single-cpt-cpt-name-%f0%9f%98%80.php', 230 'single-cpt.php', 231 'single.php', 232 'singular.php', 233 ) ); 234 } 235 236 /** 237 * @ticket 18375 238 */ 239 public function test_single_template_hierarchy_for_custom_post_type_with_template() { 240 $cpt = self::factory()->post->create_and_get( array( 241 'post_type' => 'cpt', 242 'post_name' => 'cpt-name-😀', 243 ) ); 244 add_post_meta( $cpt->ID, '_wp_page_template', 'templates/cpt.php' ); 245 246 $this->assertTemplateHierarchy( get_permalink( $cpt ), array( 247 'templates/cpt.php', 223 248 'single-cpt-cpt-name-😀.php', 224 249 'single-cpt-cpt-name-%f0%9f%98%80.php', … … 248 273 } 249 274 275 /** 276 * @ticket 18375 277 */ 278 public function test_attachment_template_hierarchy_with_template() { 279 $attachment = self::factory()->attachment->create_and_get( array( 280 'post_name' => 'attachment-name-😀', 281 'file' => 'image.jpg', 282 'post_mime_type' => 'image/jpeg', 283 ) ); 284 285 add_post_meta( $attachment, '_wp_page_template', 'templates/cpt.php' ); 286 287 $this->assertTemplateHierarchy( get_permalink( $attachment ), array( 288 'image-jpeg.php', 289 'jpeg.php', 290 'image.php', 291 'attachment.php', 292 'single-attachment-attachment-name-😀.php', 293 'single-attachment-attachment-name-%f0%9f%98%80.php', 294 'single-attachment.php', 295 'single.php', 296 'singular.php', 297 ) ); 298 } 299 250 300 public function test_embed_template_hierarchy_for_post() { 251 301 $this->assertTemplateHierarchy( get_post_embed_url( self::$post ), array( … … 253 303 'embed-post.php', 254 304 'embed.php', 305 'templates/post.php', 255 306 'single-post-post-name-😀.php', 256 307 'single-post-post-name-%f0%9f%98%80.php',
Note: See TracChangeset
for help on using the changeset viewer.