From 545b56975d6e242ef277899caf4e08a9533e3eda Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Wed, 17 Jul 2024 00:33:21 +0000 Subject: [PATCH] HTML API: Test code improvements in virtual node breadcrumb tests. Follow-up after feedback to newly-introduced tests, mostly to enhance the message when the tests fail. Developed in https://github.com/WordPress/wordpress-develop/pull/7030 Discussed in https://core.trac.wordpress.org/ticket/61646 Follow-up to [58592]. Props dmsnell, jonsurrell. See #61646. git-svn-id: https://develop.svn.wordpress.org/trunk@58741 602fd350-edb4-49c9-b593-d223f7449a82 --- .../phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php index 403f40a1da032..c3d02ba7db4fd 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php @@ -587,14 +587,14 @@ public function test_breadcrumbs_on_virtual_nodes( string $html, int $token_posi $processor->next_token(); } - $this->assertSame( $expected_tag_name, $processor->get_tag(), "Found incorrect tag name {$processor->get_tag()}." ); + $this->assertSame( $expected_tag_name, $processor->get_tag(), "Found incorrect tag name {$processor->get_token_name()}." ); if ( 'open' === $expect_open_close ) { - $this->assertFalse( $processor->is_tag_closer(), "Found closer when opener expected at {$processor->get_tag()}." ); + $this->assertFalse( $processor->is_tag_closer(), "Found closer when opener expected at {$processor->get_token_name()}." ); } else { - $this->assertTrue( $processor->is_tag_closer(), "Found opener when closer expected at {$processor->get_tag()}." ); + $this->assertTrue( $processor->is_tag_closer(), "Found opener when closer expected at {$processor->get_token_name()}." ); } - $this->assertEquals( $expected_breadcrumbs, $processor->get_breadcrumbs(), "Found incorrect breadcrumbs in {$html}." ); + $this->assertSame( $expected_breadcrumbs, $processor->get_breadcrumbs(), "Found incorrect breadcrumbs in {$html}." ); } /**