Changeset 44966 for trunk/tests/phpunit/tests/template.php
- Timestamp:
- 03/21/2019 07:47:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/template.php
r43571 r44966 14 14 protected static $post; 15 15 16 /** 17 * Page For Privacy Policy. 18 * 19 * @since 5.2.0 20 * 21 * @var WP_Post $page_for_privacy_policy 22 */ 23 protected static $page_for_privacy_policy; 24 16 25 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 17 26 self::$page_on_front = $factory->post->create_and_get( … … 46 55 set_post_format( self::$post, 'quote' ); 47 56 add_post_meta( self::$post->ID, '_wp_page_template', 'templates/post.php' ); 57 58 self::$page_for_privacy_policy = $factory->post->create_and_get( 59 array( 60 'post_type' => 'page', 61 'post_title' => 'Privacy Policy', 62 ) 63 ); 48 64 } 49 65 … … 267 283 'page-page-name-%f0%9f%98%80.php', 268 284 'page-' . self::$page->ID . '.php', 285 'page.php', 286 'singular.php', 287 ) 288 ); 289 } 290 291 /** 292 * @ticket 44005 293 * @group privacy 294 */ 295 public function test_privacy_template_hierarchy() { 296 update_option( 'wp_page_for_privacy_policy', self::$page_for_privacy_policy->ID ); 297 298 $this->assertTemplateHierarchy( 299 get_permalink( self::$page_for_privacy_policy->ID ), 300 array( 301 'privacy-policy.php', 302 'page-privacy-policy.php', 303 'page-' . self::$page_for_privacy_policy->ID . '.php', 269 304 'page.php', 270 305 'singular.php', … … 437 472 'front_page' => 'is_front_page', 438 473 'home' => 'is_home', 474 'privacy_policy' => 'is_privacy_policy', 439 475 'post_type_archive' => 'is_post_type_archive', 440 476 'taxonomy' => 'is_tax',
Note: See TracChangeset
for help on using the changeset viewer.