Make WordPress Core

Changeset 58741


Ignore:
Timestamp:
07/17/2024 12:33:21 AM (2 months ago)
Author:
dmsnell
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php

    r58677 r58741  
    588588        }
    589589
    590         $this->assertSame( $expected_tag_name, $processor->get_tag(), "Found incorrect tag name {$processor->get_tag()}." );
     590        $this->assertSame( $expected_tag_name, $processor->get_tag(), "Found incorrect tag name {$processor->get_token_name()}." );
    591591        if ( 'open' === $expect_open_close ) {
    592             $this->assertFalse( $processor->is_tag_closer(), "Found closer when opener expected at {$processor->get_tag()}." );
     592            $this->assertFalse( $processor->is_tag_closer(), "Found closer when opener expected at {$processor->get_token_name()}." );
    593593        } else {
    594             $this->assertTrue( $processor->is_tag_closer(), "Found opener when closer expected at {$processor->get_tag()}." );
    595         }
    596 
    597         $this->assertEquals( $expected_breadcrumbs, $processor->get_breadcrumbs(), "Found incorrect breadcrumbs in {$html}." );
     594            $this->assertTrue( $processor->is_tag_closer(), "Found opener when closer expected at {$processor->get_token_name()}." );
     595        }
     596
     597        $this->assertSame( $expected_breadcrumbs, $processor->get_breadcrumbs(), "Found incorrect breadcrumbs in {$html}." );
    598598    }
    599599
Note: See TracChangeset for help on using the changeset viewer.