| 812 | |
| 813 | function test_is_page_template() { |
| 814 | $post_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); |
| 815 | update_post_meta($post_id, '_wp_page_template', 'example.php'); |
| 816 | $this->go_to( "/?page_id=$post_id" ); |
| 817 | $this->assertTrue( is_page_template('example.php') ); |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * @ticket 31271 |
| 822 | */ |
| 823 | function test_is_page_template_array() { |
| 824 | $post_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); |
| 825 | update_post_meta($post_id, '_wp_page_template', 'example.php'); |
| 826 | $this->go_to( "/?page_id=$post_id" ); |
| 827 | $this->assertTrue( is_page_template( array('test.php', 'example.php') ) ); |
| 828 | $this->assertFalse( is_page_template( array('test.php') ) ); |
| 829 | } |