Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try/html api with packages update and layout.php back ports #3955

Closed
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
15863a8
Introduce HTML Tag Processor
dmsnell Jan 26, 2023
40e1cb3
Move class_exists calls to wp-html
dmsnell Jan 30, 2023
8b507e5
Mark helper classes `final`
dmsnell Jan 30, 2023
561acff
Updates from review feedback, mostly docs
dmsnell Jan 30, 2023
57550e7
WP_HTML_Tag_Processor_Test: test improvements
hellofromtonya Jan 30, 2023
b708c6b
Load API files directly from wp-settings.php
hellofromtonya Jan 30, 2023
521a500
Tests: remove loading API files
hellofromtonya Jan 30, 2023
8bdfae4
Renames test classes to coding standard
hellofromtonya Jan 30, 2023
bc17086
Renames test filenames to coding standard
hellofromtonya Jan 30, 2023
334e415
Cleans HEADS from merge conflict from test file
hellofromtonya Jan 30, 2023
def4ed4
Reword explanation of lexical updates
dmsnell Jan 31, 2023
b924e03
docblock and consistency updates, addressing some PR feedback
dmsnell Jan 31, 2023
91dc772
Move HTML processing modules into new html directory
dmsnell Jan 31, 2023
1fd0d7d
Documentation wording updates.
dmsnell Jan 31, 2023
361710d
Rename library to "HTML-API" instead of "HTML"
dmsnell Jan 31, 2023
2d1411a
Un-finalize helper classes
dmsnell Jan 31, 2023
d8fdf41
Replace throwing with trigger_error( E_USER_WARNING )
dmsnell Jan 31, 2023
1465218
Add test to check for bug when encounting unexpected </SCRIPT> closer
dmsnell Feb 1, 2023
5c1a5d5
Update tests: fix data provider and remove Exception expectation
dmsnell Feb 1, 2023
c50ffee
Lint issue
dmsnell Feb 1, 2023
9a5ccf0
Fix broken tests
dmsnell Feb 1, 2023
0053f9f
Update the WordPress packages with Gutenberg 15.0.1 changes
ntsekouras Feb 1, 2023
384c6b9
backport layout support changes
ntsekouras Feb 1, 2023
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
Prev Previous commit
Next Next commit
Update tests: fix data provider and remove Exception expectation
dmsnell committed Feb 1, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dmsnell Dennis Snell
commit 5c1a5d5529c1c8621cdec2fe78fa3c8598ced39c
4 changes: 0 additions & 4 deletions tests/phpunit/tests/html/wpHtmlTagProcessor-bookmark.php
Original file line number Diff line number Diff line change
@@ -339,8 +339,6 @@ public function test_limits_the_number_of_bookmarks() {
$p = new WP_HTML_Tag_Processor( '<ul><li>One</li><li>Two</li><li>Three</li></ul>' );
$p->next_tag( 'li' );

$this->expectException( Exception::class );

for ( $i = 0;$i < WP_HTML_Tag_Processor::MAX_BOOKMARKS;$i++ ) {
$this->assertTrue( $p->set_bookmark( "bookmark $i" ), "Could not allocate the bookmark #$i" );
}
@@ -358,8 +356,6 @@ public function test_limits_the_number_of_seek_calls() {
$p->next_tag( 'li' );
$p->set_bookmark( 'bookmark' );

$this->expectException( Exception::class );

for ( $i = 0; $i < WP_HTML_Tag_Processor::MAX_SEEK_OPS; $i++ ) {
$this->assertTrue( $p->seek( 'bookmark' ), 'Could not seek to the "bookmark"' );
}
16 changes: 8 additions & 8 deletions tests/phpunit/tests/html/wpHtmlTagProcessor.php
Original file line number Diff line number Diff line change
@@ -1733,17 +1733,17 @@ public function test_skips_contents_of_script_and_rcdata_regions($input_html ) {
/**
* Data provider
*
* @return string[]
* @return array[]
*/
public function data_skips_contents_of_script_and_rcdata_regions() {
return array(
'Balanced SCRIPT tags' => '<script>console.log("<div>");</script><div target><div>',
'Unexpected SCRIPT closer after DIV' => 'console.log("<div target>")</script><div><div>',
'Unexpected SCRIPT closer before DIV' => 'console.log("<span>")</script><div target><div>',
'Missing SCRIPT closer' => '<script>console.log("<div>");<div><div></script><div target>',
'TITLE before DIV' => '<title><div></title><div target><div>',
'SCRIPT inside TITLE' => '<title><script><div></title><div target><div></script><div>',
'TITLE in TEXTAREA' => '<textarea><div><title><div></textarea><div target></title><div>',
'Balanced SCRIPT tags' => array( '<script>console.log("<div>");</script><div target><div>' ),
'Unexpected SCRIPT closer after DIV' => array( 'console.log("<div target>")</script><div><div>' ),
'Unexpected SCRIPT closer before DIV' => array( 'console.log("<span>")</script><div target><div>' ),
'Missing SCRIPT closer' => array( '<script>console.log("<div>");<div><div></script><div target>' ),
'TITLE before DIV' => array( '<title><div></title><div target><div>' ),
'SCRIPT inside TITLE' => array( '<title><script><div></title><div target><div></script><div>' ),
'TITLE in TEXTAREA' => array( '<textarea><div><title><div></textarea><div target></title><div>' ),
);
}