Changeset 38951 for trunk/tests/phpunit/tests/admin/includesTheme.php
- Timestamp:
- 10/26/2016 08:06:43 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/admin/includesTheme.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesTheme.php
r25409 r38951 49 49 switch_theme( $theme['Template'], $theme['Stylesheet'] ); 50 50 51 $t emplates = get_page_templates();52 $this->assertCount( 3, $templates );53 $this->assertEquals( "template-top-level.php", $templates['Top Level'] );54 $this->assertEquals( "subdir/template-sub-dir.php", $templates['Sub Dir'] );55 $this->assertEquals( "template-header.php", $templates['This Template Header Is On One Line']);51 $this->assertEqualSetsWithIndex( array( 52 'Top Level' => 'template-top-level.php', 53 'Sub Dir' => 'subdir/template-sub-dir.php', 54 'This Template Header Is On One Line' => 'template-header.php', 55 ), get_page_templates() ); 56 56 57 57 $theme = wp_get_theme( 'page-templates' ); … … 60 60 switch_theme( $theme['Template'], $theme['Stylesheet'] ); 61 61 62 $templates = get_page_templates(); 63 $this->assertCount( 3, $templates ); 64 $this->assertEquals( "template-top-level.php", $templates['Top Level'] ); 65 $this->assertEquals( "subdir/template-sub-dir.php", $templates['Sub Dir'] ); 66 $this->assertEquals( "template-header.php", $templates['This Template Header Is On One Line'] ); 62 $this->assertEqualSetsWithIndex( array( 63 'Top Level' => 'template-top-level.php', 64 'Sub Dir' => 'subdir/template-sub-dir.php', 65 'This Template Header Is On One Line' => 'template-header.php', 66 ), get_page_templates() ); 67 } 68 69 /** 70 * @ticket 18375 71 */ 72 function test_page_templates_different_post_types() { 73 $theme = wp_get_theme( 'page-templates' ); 74 $this->assertNotEmpty( $theme ); 75 76 switch_theme( $theme['Template'], $theme['Stylesheet'] ); 77 78 $this->assertEqualSetsWithIndex( array( 79 'Top Level' => 'template-top-level-post-types.php', 80 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', 81 ), get_page_templates( null, 'foo' ) ); 82 $this->assertEqualSetsWithIndex( array( 83 'Top Level' => 'template-top-level-post-types.php', 84 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', 85 ), get_page_templates( null, 'post' ) ); 86 $this->assertEquals( array(), get_page_templates( null, 'bar' ) ); 67 87 } 68 88 }
Note: See TracChangeset
for help on using the changeset viewer.