Skip to content
Merged
Changes from 4 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4887c5c
Introduce `WP_HTML_Walker` for reliably modifying HTML attributes.
dmsnell Aug 12, 2022
3f148db
Add TODO for `/` in attribute area
dmsnell Aug 12, 2022
6d089f2
Add TODO for handling character references in `class` attribute
dmsnell Aug 12, 2022
2dbfa03
Add TODO for attribute escaping
dmsnell Aug 12, 2022
fadd51b
Ignore slashes when parsing attribute names
adamziel Aug 15, 2022
17879e8
Remove test_get_tag_returns_raw_open_tag_name as get_tag always retur…
adamziel Aug 15, 2022
bdd56a6
Correctly check the indices of <!-- characters in skip_script_data -
adamziel Aug 15, 2022
8a48fab
Fix linting issues
gziolo Aug 16, 2022
e9a71d6
Improve existing unit tests
gziolo Aug 16, 2022
9bcfd3a
Don't close the walker in the __toString() method
adamziel Aug 18, 2022
f6d1bcc
Code style update
adamziel Aug 18, 2022
541d86b
Update phpunit/html/wp-html-walker-test.php
adamziel Aug 19, 2022
cdd8ae0
Update phpunit/html/wp-html-walker-test.php
adamziel Aug 19, 2022
1852cf7
Update lib/experimental/html/class-wp-html-walker.php
adamziel Aug 19, 2022
6c4647d
Update lib/experimental/html/class-wp-html-walker.php
adamziel Aug 19, 2022
4554dd3
Update lib/experimental/html/class-wp-html-walker.php
dmsnell Sep 22, 2022
e2eb423
Refactor early-abort to remove level of nesting
dmsnell Sep 22, 2022
68b55c4
Rewrite code to separate stages of computation
dmsnell Sep 22, 2022
f664c08
Expand name of $c to $character
dmsnell Sep 22, 2022
147647b
typo: type of integer is `int`
dmsnell Sep 22, 2022
d8b8ddd
typo: type of integer is `int`
dmsnell Sep 22, 2022
a325fa3
Reorder the test methods
adamziel Sep 23, 2022
a4fb703
Add the missing error messages
adamziel Sep 23, 2022
c017420
Reorder tests to keep set_attribute tests grouped together
adamziel Sep 23, 2022
07041ee
Update phpunit/html/wp-html-walker-test.php
adamziel Sep 23, 2022
63f4e34
Update phpunit/html/wp-html-walker-test.php
adamziel Sep 23, 2022
1021d9b
Update phpunit/html/wp-html-walker-test.php
adamziel Sep 23, 2022
e0910be
Explain the test_set_attribute_takes_priority_over_add_class test
adamziel Sep 23, 2022
273c502
Merge branch 'add/html-tokenizer-2' of github.com:WordPress/gutenberg…
adamziel Sep 23, 2022
19a8546
Rename test_works_with_single_quote_marks to test_parses_html_attribu…
adamziel Sep 23, 2022
c96f08b
Update the test names to suggest the failure mode
adamziel Sep 23, 2022
218afe4
Update phpunit/html/wp-html-walker-test.php
adamziel Sep 23, 2022
81d43e2
Add covers annotations
adamziel Sep 23, 2022
53143f8
Rename WP_HTML_Walker to WP_HTML_Tag_Processor
adamziel Sep 23, 2022
bddc2db
Remove the is_closed method, as the idea of a closed walker does not …
adamziel Sep 23, 2022
f299bf0
Update lib/experimental/html/class-wp-html-text-replacement.php
adamziel Sep 23, 2022
13c3270
Update lib/experimental/html/class-wp-html-attribute-token.php
adamziel Sep 23, 2022
5c2d080
Rename $w to $p
adamziel Sep 23, 2022
509684c
Merge branch 'add/html-tokenizer-2' of github.com:WordPress/gutenberg…
adamziel Sep 23, 2022
d9d3bab
Rename phpdoc references to $w to $p
adamziel Sep 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions phpunit/html/wp-html-walker-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,23 @@ public function test_calling_tostring_applies_the_updates_so_far_and_keeps_the_w
/**
* @ticket 56299
*/
public function test_to_string_with_no_updates_returns_the_original_html() {
public function test_tostring_with_no_updates_returns_the_original_html() {
$w = new WP_HTML_Walker( self::HTML_SIMPLE );
$this->assertSame( self::HTML_SIMPLE, (string) $w );
}

/**
* @ticket 56299
*/
public function test_finding_any_existing_tag() {
public function test_next_tag_with_no_arguments_should_find_the_next_existing_tag() {
$w = new WP_HTML_Walker( self::HTML_SIMPLE );
$this->assertTrue( $w->next_tag(), 'Querying an existing tag did not return true' );
}

/**
* @ticket 56299
*/
public function test_finding_non_existing_tag() {
public function test_next_tag_should_return_false_for_a_non_existing_tag() {
$w = new WP_HTML_Walker( self::HTML_SIMPLE );
$this->assertFalse( $w->next_tag( 'p' ), 'Querying a non-existing tag did not return false' );
}
Expand Down