|
12 | 12 | */ |
13 | 13 | class Tests_Block_Template_Utils extends WP_UnitTestCase { |
14 | 14 | private static $post; |
15 | | - private static $custom_single_post_template_post; |
16 | 15 | private static $template_part_post; |
17 | 16 | private static $test_theme = 'block-theme'; |
18 | 17 |
|
@@ -51,22 +50,6 @@ public static function wpSetUpBeforeClass() { |
51 | 50 | self::$post = self::factory()->post->create_and_get( $args ); |
52 | 51 | wp_set_post_terms( self::$post->ID, self::$test_theme, 'wp_theme' ); |
53 | 52 |
|
54 | | - // Set up template post. |
55 | | - $args = array( |
56 | | - 'post_type' => 'wp_template', |
57 | | - 'post_name' => 'custom-single-post-template', |
58 | | - 'post_title' => 'Custom Single Post template (modified)', |
59 | | - 'post_content' => 'Content', |
60 | | - 'post_excerpt' => 'Description of custom single post template', |
61 | | - 'tax_input' => array( |
62 | | - 'wp_theme' => array( |
63 | | - self::$test_theme, |
64 | | - ), |
65 | | - ), |
66 | | - ); |
67 | | - self::$custom_single_post_template_post = self::factory()->post->create_and_get( $args ); |
68 | | - wp_set_post_terms( self::$custom_single_post_template_post->ID, self::$test_theme, 'wp_theme' ); |
69 | | - |
70 | 53 | // Set up template part post. |
71 | 54 | $template_part_args = array( |
72 | 55 | 'post_type' => 'wp_template_part', |
@@ -95,7 +78,6 @@ public function set_up() { |
95 | 78 |
|
96 | 79 | public static function wpTearDownAfterClass() { |
97 | 80 | wp_delete_post( self::$post->ID ); |
98 | | - wp_delete_post( self::$custom_single_post_template_post->ID ); |
99 | 81 | } |
100 | 82 |
|
101 | 83 | public function test_build_block_template_result_from_post() { |
@@ -339,62 +321,6 @@ static function( $template ) { |
339 | 321 | */ |
340 | 322 | } |
341 | 323 |
|
342 | | - /** |
343 | | - * @dataProvider data_get_block_template_should_respect_posttypes_property |
344 | | - * @ticket 55881 |
345 | | - * @covers ::get_block_templates |
346 | | - * |
347 | | - * @param string $post_type Post type for query. |
348 | | - * @param array $expected Expected template IDs. |
349 | | - */ |
350 | | - public function test_get_block_template_should_respect_posttypes_property( $post_type, $expected ) { |
351 | | - $templates = get_block_templates( array( 'post_type' => $post_type ) ); |
352 | | - |
353 | | - $this->assertSame( |
354 | | - $expected, |
355 | | - $this->get_template_ids( $templates ) |
356 | | - ); |
357 | | - } |
358 | | - |
359 | | - /** |
360 | | - * Data provider. |
361 | | - * |
362 | | - * @return array |
363 | | - */ |
364 | | - public function data_get_block_template_should_respect_posttypes_property() { |
365 | | - return array( |
366 | | - 'post' => array( |
367 | | - 'post_type' => 'post', |
368 | | - 'expected' => array( |
369 | | - 'block-theme//my_template', |
370 | | - 'block-theme//custom-single-post-template', |
371 | | - ), |
372 | | - ), |
373 | | - 'page' => array( |
374 | | - 'post_type' => 'page', |
375 | | - 'expected' => array( |
376 | | - 'block-theme//my_template', |
377 | | - 'block-theme//page-home', |
378 | | - ), |
379 | | - ), |
380 | | - ); |
381 | | - } |
382 | | - |
383 | | - /** |
384 | | - * Gets the template IDs from the given array. |
385 | | - * |
386 | | - * @param object[] $templates Array of template objects to parse. |
387 | | - * @return string[] The template IDs. |
388 | | - */ |
389 | | - private function get_template_ids( $templates ) { |
390 | | - return array_map( |
391 | | - static function( $template ) { |
392 | | - return $template->id; |
393 | | - }, |
394 | | - $templates |
395 | | - ); |
396 | | - } |
397 | | - |
398 | 324 | /** |
399 | 325 | * Should flatten nested blocks |
400 | 326 | */ |
|
0 commit comments