From d25a8d62f7c2186593ef5d53b496a1bfc5d7f317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=83=C2=A9?= Date: Fri, 23 Jun 2023 09:28:10 +0000 Subject: [PATCH] Fix block template utils test: use template part instead of template object. Note that the PHP unit tests didn't fail in the CI job because the date for both the template and template part was the same. Props ramonopoly. Fixes #58540. git-svn-id: https://develop.svn.wordpress.org/trunk@55993 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/block-template-utils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php index 85588d2fd9..270d15f3d3 100644 --- a/tests/phpunit/tests/block-template-utils.php +++ b/tests/phpunit/tests/block-template-utils.php @@ -101,7 +101,7 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase { $this->assertSame( 'My Template', $template->title ); $this->assertSame( 'Description of my template', $template->description ); $this->assertSame( 'wp_template', $template->type ); - $this->assertSame( self::$template_post->post_modified, $template->modified ); + $this->assertSame( self::$template_post->post_modified, $template->modified, 'Template result properties match' ); // Test template parts. $template_part = _build_block_template_result_from_post( @@ -118,7 +118,7 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase { $this->assertSame( 'Description of my template part', $template_part->description ); $this->assertSame( 'wp_template_part', $template_part->type ); $this->assertSame( WP_TEMPLATE_PART_AREA_HEADER, $template_part->area ); - $this->assertSame( self::$template_part_post->post_modified, $template->modified ); + $this->assertSame( self::$template_part_post->post_modified, $template_part->modified, 'Template part result properties match' ); } public function test_build_block_template_result_from_file() {