Changeset 57649 for trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIDirectivesProcessor.php
- Timestamp:
- 02/17/2024 03:26:43 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIDirectivesProcessor.php
r57563 r57649 12 12 * @coversDefaultClass WP_Interactivity_API_Directives_Processor 13 13 */ 14 class Tests_ WP_Interactivity_API_Directives_Processor extends WP_UnitTestCase {14 class Tests_Interactivity_API_WpInteractivityAPIDirectivesProcessor extends WP_UnitTestCase { 15 15 /** 16 16 * Tests the `get_content_between_balanced_template_tags` method on template … … 779 779 $this->assertFalse( $p->next_balanced_tag_closer_tag() ); 780 780 } 781 782 /** 783 * Tests that skip_to_tag_closer skips to the next tag, 784 * independant of the content. 785 * 786 * @ticket 60517 787 * 788 * @covers ::skip_to_tag_closer 789 */ 790 public function test_skip_to_tag_closer() { 791 $content = '<div><span>Not closed</div>'; 792 $p = new WP_Interactivity_API_Directives_Processor( $content ); 793 $p->next_tag(); 794 $this->assertTrue( $p->skip_to_tag_closer() ); 795 $this->assertTrue( $p->is_tag_closer() ); 796 $this->assertEquals( 'DIV', $p->get_tag() ); 797 } 798 799 /** 800 * Tests that skip_to_tag_closer does not skip to the 801 * next tag if there is no closing tag. 802 * 803 * @ticket 60517 804 * 805 * @covers ::skip_to_tag_closer 806 */ 807 public function test_skip_to_tag_closer_bails_not_closed() { 808 $content = '<div>Not closed parent'; 809 $p = new WP_Interactivity_API_Directives_Processor( $content ); 810 $p->next_tag(); 811 $this->assertFalse( $p->skip_to_tag_closer() ); 812 } 813 814 /** 815 * Tests that skip_to_tag_closer does not skip to the next 816 * tag if the closing tag is different from the current tag. 817 * 818 * @ticket 60517 819 * 820 * @covers ::skip_to_tag_closer 821 */ 822 public function test_skip_to_tag_closer_bails_different_tags() { 823 $content = '<div></span>'; 824 $p = new WP_Interactivity_API_Directives_Processor( $content ); 825 $p->next_tag(); 826 $this->assertFalse( $p->skip_to_tag_closer() ); 827 } 781 828 }
Note: See TracChangeset
for help on using the changeset viewer.