Skip to content

Commit

Permalink
Add basic coverage for gutenberg_get_template_slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Jun 27, 2022
1 parent 62953df commit cdc7395
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions phpunit/compat/wordpress-6.1/block-template-utils-test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Tests_Block_Template_Utils class
*
* @package gutenberg
*/

/**
* Tests for the Block Templates abstraction layer.
*
* @group block-templates
*/
class Tests_Block_Template_Utils_6_1 extends WP_UnitTestCase {
public function test_get_template_slugs() {
$templates = gutenberg_get_template_slugs( 'single-post-hello-world' );
$this->assertSame(
array(
'single-post-hello-world',
// Should *not* fall back to `single-post-hello`!
'single-post',
'single',
),
$templates
);
}
}

0 comments on commit cdc7395

Please sign in to comment.