Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ jobs:
php: [ '7.4', '8.0', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '8.4' ]
phpunit-test-groups: [ 'html-api-html5lib-tests' ]
phpunit-test-groups: [ 'html-api-web-platform-tests' ]
# A matrix value is needed in the 'name' directive for proper grouping in the GitHub UI.
label: [ 'HTML API' ]
with:
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
- php: '8.4'
db-version: '9.7'
db-type: 'mysql'
phpunit-test-groups: 'html-api-html5lib-tests'
phpunit-test-groups: 'html-api-web-platform-tests'

exclude:
# Exclude PHP versions that are not supported by the database versions.
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<group>ms-files</group>
<group>ms-required</group>
<group>external-http</group>
<group>html-api-html5lib-tests</group>
<group>html-api-web-platform-tests</group>
</exclude>
</groups>
<logging>
Expand Down
34 changes: 0 additions & 34 deletions tests/phpunit/data/html5lib-tests/AUTHORS.rst

This file was deleted.

21 changes: 0 additions & 21 deletions tests/phpunit/data/html5lib-tests/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions tests/phpunit/data/html5lib-tests/README.md

This file was deleted.

11 changes: 11 additions & 0 deletions tests/phpunit/data/web-platform-tests/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The 3-Clause BSD License

Copyright © web-platform-tests contributors

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 changes: 19 additions & 0 deletions tests/phpunit/data/web-platform-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Web Platform Tests

This directory contains a third-party test suite used for testing the WordPress HTML API.

The tests are maintained by the Web Platform Tests project.
The current tests can be found on GitHub at
[`web-platform-tests/wpt/html/syntax/parsing/resources`](https://github.com/web-platform-tests/wpt/tree/master/html/syntax/parsing/resources).

The version of the WPT files was taken from the git commit with
SHA [`f4c2ec1d071ccbae305f7aea4e883b5bd0f5c0df`](https://github.com/web-platform-tests/wpt/commit/f4c2ec1d071ccbae305f7aea4e883b5bd0f5c0df).

## Updating

If there have been changes to the Web Platform Tests repository, this test suite can be updated. In
order to update:

1. Check out the latest version of git repository mentioned above.
1. Replace the local `html_syntax_parsing_resources/` directory with the WPT repo's `html/syntax/parsing/resources` directory.
1. Update the SHA mentioned in this README file with the new Web Platform Tests SHA.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ errors.

Then there \*may\* be a line that says "\#document-fragment", which must
be followed by a newline (LF), followed by a string of characters that
indicates the context element, followed by a newline (LF). If the string
indicates the context element, followed by a newline (LF). If the string
of characters starts with "svg ", the context element is in the SVG
namespace and the substring after "svg " is the local name. If the
string of characters starts with "math ", the context element is in the
Expand Down Expand Up @@ -67,9 +67,7 @@ per parent node that the node has before the root document node.
double-quotes, another space an the system id in double-quotes, and
then in any case "`>`".
- Processing instructions must be "`<?`", then the target, then a
space, then the data and then "`>`". (The HTML parser cannot emit
processing instructions, but scripts can, and the WebVTT to DOM
rules can emit them.)
space, then the data and then "`?>`".
- Template contents are represented by the string "content" with the
children below it.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,20 @@
| <address>
| <a>
| <a>

#data
<nobr><table><marquee></table><nobr>
#errors
(1,6): expected-doctype-but-got-start-tag
(1,22): unexpected-start-tag-implies-table-voodoo
(1,30): end-tag-too-early-named
(1,36): unexpected-start-tag-implies-end-tag
(1,36): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <nobr>
| <marquee>
| <table>
| <nobr>
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#new-errors
(1:2) unexpected-question-mark-instead-of-tag-name
#document
| <!-- ?import namespace="foo" implementation="#bar" -->
| <?import namespace="foo" implementation="#bar"?>
| <html>
| <head>
| <body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@
#data
<!DOCTYPE html><select><menuitem></select>
#errors
33: Stray start tag menuitem.
1:34: ERROR: End tag 'select' isn't allowed here. Currently open tags: html, body, select, menuitem.
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| <menuitem>

#data
<!DOCTYPE html><option><menuitem>
Expand Down
Loading
Loading