Skip to content

Commit f670c8d

Browse files
committed
Build/Test Tools: Run the final HTML API web platform test case.
The web-platform-tests data provider used `return` instead of `yield` for the last case in each file, preventing it from running. Developed in WordPress#12509. Follow-up to [58010]. See #64894. git-svn-id: https://develop.svn.wordpress.org/trunk@62724 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 93a95e7 commit f670c8d

1 file changed

Lines changed: 30 additions & 22 deletions

File tree

tests/phpunit/tests/html-api/wpHtmlProcessorWebPlatformTests.php

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@ class Tests_HtmlApi_WebPlatformTests extends WP_UnitTestCase {
2727
* Skip specific tests that may not be supported or have known issues.
2828
*/
2929
const SKIP_TESTS = array(
30-
'noscript01/line0014' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
31-
'tests14/line0022' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
32-
'tests14/line0055' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
33-
'tests19/line0488' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
34-
'tests19/line0500' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
35-
'tests19/line1079' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
36-
'tests2/line0207' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
37-
'tests2/line0686' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
38-
'tests2/line0697' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
39-
'tests2/line0709' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
40-
'webkit01/line0231' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
41-
'webkit02/line0692' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
42-
'webkit02/line0732' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
43-
'webkit02/line0748' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
30+
'noscript01/line0014' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
31+
'tests14/line0022' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
32+
'tests14/line0055' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
33+
'tests19/line0488' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
34+
'tests19/line0500' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
35+
'tests19/line1079' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
36+
'tests2/line0207' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
37+
'tests2/line0686' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
38+
'tests2/line0697' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
39+
'tests2/line0709' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
40+
'webkit01/line0231' => 'Unimplemented: This parser does not add missing attributes to existing HTML or BODY tags.',
41+
'webkit02/line0692' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
42+
'webkit02/line0732' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
43+
'webkit02/line0748' => 'Unimplemented: The parser does not implement the "maybe clone an option into selectedcontent" algorithm.',
44+
'processing-instructions/line0999' => 'Temporarily disabled invalid test.',
4445
);
4546

4647
/**
@@ -463,13 +464,20 @@ public static function parse_web_platform_test_file( $filename ) {
463464

464465
fclose( $handle );
465466

466-
// Return the last result when reaching the end of the file.
467-
return array(
468-
$test_line_number,
469-
$test_context_element,
470-
// Remove the trailing newline
471-
substr( $test_html, 0, -1 ),
472-
$test_dom,
473-
);
467+
// Yield the last result when reaching the end of the file.
468+
if ( $state && ! $test_script_flag ) {
469+
// Other tests include the blank line separating them from the next test.
470+
if ( ! str_ends_with( $test_dom, "\n\n" ) ) {
471+
$test_dom .= "\n";
472+
}
473+
474+
yield array(
475+
$test_line_number,
476+
$test_context_element,
477+
// Remove the trailing newline
478+
substr( $test_html, 0, -1 ),
479+
$test_dom,
480+
);
481+
}
474482
}
475483
}

0 commit comments

Comments
 (0)