Skip to content

Commit d2686fb

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents ed1955e + 022155d commit d2686fb

2 files changed

Lines changed: 50 additions & 39 deletions

File tree

tests/phpunit/tests/admin/includesTheme.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -183,45 +183,6 @@ public function test_page_templates_child_theme() {
183183
$this->assertSame( array(), get_page_templates( null, 'bar' ) );
184184
}
185185

186-
/**
187-
* @ticket 41717
188-
*/
189-
public function test_get_post_templates_child_theme() {
190-
$theme = wp_get_theme( 'page-templates-child' );
191-
$this->assertNotEmpty( $theme );
192-
193-
switch_theme( $theme['Template'], $theme['Stylesheet'] );
194-
195-
$post_templates = $theme->get_post_templates();
196-
197-
$this->assertSameSetsWithIndex(
198-
array(
199-
'template-top-level-post-types.php' => 'Top Level',
200-
'subdir/template-sub-dir-post-types.php' => 'Sub Dir',
201-
'template-top-level-post-types-child.php' => 'Top Level In A Child Theme',
202-
'subdir/template-sub-dir-post-types-child.php' => 'Sub Dir In A Child Theme',
203-
),
204-
$post_templates['foo']
205-
);
206-
207-
$this->assertSameSetsWithIndex(
208-
array(
209-
'template-top-level-post-types.php' => 'Top Level',
210-
'subdir/template-sub-dir-post-types.php' => 'Sub Dir',
211-
),
212-
$post_templates['post']
213-
);
214-
215-
$this->assertSameSetsWithIndex(
216-
array(
217-
'template-top-level.php' => 'Top Level',
218-
'subdir/template-sub-dir.php' => 'Sub Dir',
219-
'template-header.php' => 'This Template Header Is On One Line',
220-
),
221-
$post_templates['page']
222-
);
223-
}
224-
225186
/**
226187
* Test that the list of theme features pulled from the WordPress.org API returns the expected data structure.
227188
*
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/**
4+
* Tests for WP_Theme::get_post_templates().
5+
*
6+
* @group themes
7+
*
8+
* @covers WP_Theme::get_post_templates
9+
*/
10+
class Tests_Theme_wpThemeGetPostTemplates extends WP_UnitTestCase {
11+
12+
/**
13+
* @ticket 41717
14+
*/
15+
public function test_get_post_templates_child_theme() {
16+
$theme = wp_get_theme( 'page-templates-child' );
17+
$this->assertNotEmpty( $theme );
18+
19+
switch_theme( $theme['Template'], $theme['Stylesheet'] );
20+
21+
$post_templates = $theme->get_post_templates();
22+
23+
$this->assertSameSetsWithIndex(
24+
array(
25+
'template-top-level-post-types.php' => 'Top Level',
26+
'subdir/template-sub-dir-post-types.php' => 'Sub Dir',
27+
'template-top-level-post-types-child.php' => 'Top Level In A Child Theme',
28+
'subdir/template-sub-dir-post-types-child.php' => 'Sub Dir In A Child Theme',
29+
),
30+
$post_templates['foo']
31+
);
32+
33+
$this->assertSameSetsWithIndex(
34+
array(
35+
'template-top-level-post-types.php' => 'Top Level',
36+
'subdir/template-sub-dir-post-types.php' => 'Sub Dir',
37+
),
38+
$post_templates['post']
39+
);
40+
41+
$this->assertSameSetsWithIndex(
42+
array(
43+
'template-top-level.php' => 'Top Level',
44+
'subdir/template-sub-dir.php' => 'Sub Dir',
45+
'template-header.php' => 'This Template Header Is On One Line',
46+
),
47+
$post_templates['page']
48+
);
49+
}
50+
}

0 commit comments

Comments
 (0)