Skip to content

Commit

Permalink
Add skipping of certain tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 19, 2023
1 parent d16c5a0 commit b720c3a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@
* @package WordPress
* @subpackage HTML-API
*
* @since TODO
* @since {WP_VERSION}
*
* @group html-api
*
* @coversDefaultClass WP_HTML_Processor
*/
class Tests_HtmlApi_WpHtmlProcessorHtml5lib extends WP_UnitTestCase {

const SKIP_TESTS = array(
'adoption01/case10 - line 159' => 'Unimplemented: Reconstruction of active formatting elements.',
'adoption01/case17 - line 318' => 'Unimplemented: Reconstruction of active formatting elements.',
'adoption01/case4 - line 46' => 'Unimplemented: Reconstruction of active formatting elements.',
'tests15/case1 - line 1' => 'Unimplemented: Reconstruction of active formatting elements.',
'tests15/case2 - line 22' => 'Unimplemented: Reconstruction of active formatting elements.',
);

/**
* Verify the parsing results of the HTML Processor against the
* test cases in the Html5lib tests project.
Expand All @@ -27,6 +36,11 @@ class Tests_HtmlApi_WpHtmlProcessorHtml5lib extends WP_UnitTestCase {
*/
public function test_external_html5lib( $fragment_context, $html, $result ) {
$processed_tree = self::build_html5_treelike_string( $fragment_context, $html );

if ( array_key_exists( $this->dataName(), self::SKIP_TESTS ) ) {
$this->markTestSkipped( self::SKIP_TESTS[$this->dataName()] );

Check failure on line 41 in tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Array keys must be surrounded by spaces unless they contain a string or an integer.
}

if ( null === $processed_tree ) {
$this->markTestSkipped( 'Skipped test because it contains unsupported markup.' );
} else {
Expand Down

0 comments on commit b720c3a

Please sign in to comment.