You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->assertTrue( $p->next_tag( 'BUTTON' ), 'Could not find expected first button.' );
85
+
$this->assertTrue( $p->get_attribute( 'one' ), 'Failed to match expected attribute on first button.' );
86
+
$this->assertSame( array( 'HTML', 'BODY', 'DIV', 'P', 'BUTTON' ), $p->get_breadcrumbs(), 'Failed to produce expected DOM nesting for first button.' );
87
+
88
+
/*
89
+
* A naive parser might skip the second BUTTON because it's looking for the close of the first one,
90
+
* or it may place it as a child of the first one, but it implicitly closes the open BUTTON.
91
+
*/
92
+
$this->assertTrue( $p->next_tag( 'BUTTON' ), 'Could not find expected second button.' );
93
+
$this->assertTrue( $p->get_attribute( 'two' ), 'Failed to match expected attribute on second button.' );
94
+
$this->assertSame( array( 'HTML', 'BODY', 'DIV', 'P', 'BUTTON' ), $p->get_breadcrumbs(), 'Failed to produce expected DOM nesting for second button.' );
95
+
96
+
/*
97
+
* This is another form of the test for the second button, but from a different side. The test is
98
+
* looking for proper handling of the open and close sequence for the BUTTON tags.
99
+
*/
100
+
$this->assertTrue( $p->next_tag( 'BUTTON' ), 'Could not find expected third button.' );
101
+
$this->assertTrue( $p->get_attribute( 'three' ), 'Failed to match expected attribute on third button.' );
102
+
$this->assertSame( array( 'HTML', 'BODY', 'BUTTON' ), $p->get_breadcrumbs(), 'Failed to produce expected DOM nesting for third button.' );
103
+
}
104
+
105
+
/**
106
+
* Verifies what when inserting a BUTTON element, when a BUTTON is already in scope,
107
+
* that the open button is closed with all other elements inside of it, even if the
108
+
* BUTTON in scope is not a direct parent of the new BUTTON element.
0 commit comments