diff --git a/phpunit/html/wp-html-tag-processor-test.php b/phpunit/html/wp-html-tag-processor-test.php index eddfc68fbe845..56b7f312971cf 100644 --- a/phpunit/html/wp-html-tag-processor-test.php +++ b/phpunit/html/wp-html-tag-processor-test.php @@ -266,6 +266,29 @@ public function test_get_attribute_names_returns_attribute_names() { ); } + /** + * @ticket 56299 + * + * @covers set_attribute + * @covers get_updated_html + * @covers get_attribute_names + */ + public function test_get_attribute_names_returns_attribute_added_by_set_attribute() { + $p = new WP_HTML_Tag_Processor( '
Test
' ); + $p->next_tag(); + $p->set_attribute( 'test-attribute', 'test-value' ); + $this->assertSame( + '
Test
', + $p->get_updated_html(), + "Updated HTML doesn't include attribute added via set_attribute" + ); + $this->assertSame( + array( 'test-attribute', 'class' ), + $p->get_attribute_names(), + "Accessing attribute names doesn't find attribute added via set_attribute" + ); + } + /** * @ticket 56299 *