Move the template_id construction logic to Templates class

[MAILPOET-6356]
This commit is contained in:
Rostislav Wolny
2024-12-13 17:35:14 +01:00
committed by Rostislav Wolný
parent a5db2564c8
commit 9b9187bb3e
3 changed files with 8 additions and 7 deletions

View File

@@ -35,12 +35,11 @@ class Templates_Test extends \MailPoetTest {
* @return void
*/
public function testItCanFetchBlockTemplate(): void {
$template_id = get_stylesheet() . '//email-general'; // Templates id is prefixed with the theme name.
$template = $this->templates->get_block_template( $template_id );
$template = $this->templates->get_block_template( 'email-general' );
self::assertInstanceOf( \WP_Block_Template::class, $template );
verify( $template->slug )->equals( 'email-general' );
verify( $template->id )->equals( $template_id );
verify( $template->id )->stringContainsString( 'email-general' );
verify( $template->title )->equals( 'General Email' );
verify( $template->description )->equals( 'A general template for emails.' );
}