Skip to content

Commit

Permalink
Remove tests which are no longer applicable.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz authored and ockham committed Oct 12, 2023
1 parent 5c27373 commit 44d7eab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 104 deletions.
58 changes: 0 additions & 58 deletions tests/phpunit/tests/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,64 +161,6 @@ public function test_build_block_template_result_from_file() {
$this->assertEmpty( $template_part->modified );
}

/**
* @ticket 59325
*
* @covers ::_build_block_template_result_from_file
*
* @dataProvider data_build_block_template_result_from_file_injects_theme_attribute
*
* @param string $filename The template's filename.
* @param string $expected The expected block markup.
*/
public function test_build_block_template_result_from_file_injects_theme_attribute( $filename, $expected ) {
$template = _build_block_template_result_from_file(
array(
'slug' => 'single',
'path' => DIR_TESTDATA . "/templates/$filename",
),
'wp_template'
);
$this->assertSame( $expected, $template->content );
}

/**
* Data provider.
*
* @return array[]
*/
public function data_build_block_template_result_from_file_injects_theme_attribute() {
$theme = 'block-theme';
return array(
'a template with a template part block' => array(
'filename' => 'template-with-template-part.html',
'expected' => sprintf(
'<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header","theme":"%s"} /-->',
$theme
),
),
'a template with a template part block nested inside another block' => array(
'filename' => 'template-with-nested-template-part.html',
'expected' => sprintf(
'<!-- wp:group -->
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header","theme":"%s"} /-->
<!-- /wp:group -->',
$theme
),
),
'a template with a template part block with an existing theme attribute' => array(
'filename' => 'template-with-template-part-with-existing-theme-attribute.html',
'expected' => '<!-- wp:template-part {"slug":"header","theme":"fake-theme","align":"full","tagName":"header","className":"site-header"} /-->',
),
'a template with no template part block' => array(
'filename' => 'template.html',
'expected' => '<!-- wp:paragraph -->
<p>Just a paragraph</p>
<!-- /wp:paragraph -->',
),
);
}

/**
* @ticket 59338
*
Expand Down
46 changes: 0 additions & 46 deletions tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,29 +316,6 @@ public function test_get_registered() {
$this->assertSame( $pattern_two, $pattern );
}

/**
* Should insert a theme attribute into Template Part blocks in registered patterns.
*
* @ticket 59583
*
* @covers WP_Block_Patterns_Registry::register
* @covers WP_Block_Patterns_Registry::get_all_registered
*/
public function test_get_all_registered_includes_theme_attribute() {
$test_pattern = array(
'title' => 'Test Pattern',
'content' => '<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->',
);
$this->registry->register( 'test/pattern', $test_pattern );

$expected = sprintf(
'<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header","theme":"%s"} /-->',
get_stylesheet()
);
$patterns = $this->registry->get_all_registered();
$this->assertSame( $expected, $patterns[0]['content'] );
}

/**
* Should insert hooked blocks into registered patterns.
*
Expand Down Expand Up @@ -391,29 +368,6 @@ public function test_get_all_registered_includes_hooked_blocks() {
$this->assertSame( $expected, $registered );
}

/**
* Should insert a theme attribute into Template Part blocks in registered patterns.
*
* @ticket 59583
*
* @covers WP_Block_Patterns_Registry::register
* @covers WP_Block_Patterns_Registry::get_registered
*/
public function test_get_registered_includes_theme_attribute() {
$test_pattern = array(
'title' => 'Test Pattern',
'content' => '<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->',
);
$this->registry->register( 'test/pattern', $test_pattern );

$expected = sprintf(
'<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header","theme":"%s"} /-->',
get_stylesheet()
);
$pattern = $this->registry->get_registered( 'test/pattern' );
$this->assertSame( $expected, $pattern['content'] );
}

/**
* Should insert hooked blocks into registered patterns.
*
Expand Down

0 comments on commit 44d7eab

Please sign in to comment.