Skip to content

Commit

Permalink
Skip unhandled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 18, 2023
1 parent 77cfb12 commit 7843f2b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ class Tests_HtmlApi_WpHtmlProcessorHtml5lib extends WP_UnitTestCase {
* @dataProvider data_external_html5lib_tests
*/
public function test_external_html5lib( $html, $result ) {
$processed = self::build_html5_treelike_string( $html );

$processed_tree = self::build_html5_treelike_string( $html );
$this->assertEquals( $processed_tree, $result );
if ( $processed["error"] === "unsupported" ) {

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "error" does not require double quotes; use single quotes instead

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

Use Yoda Condition checks, you must.

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "unsupported" does not require double quotes; use single quotes instead
$this->markTestSkipped();
return;
}

$this->assertEquals( $processed["output"], $result );

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "output" does not require double quotes; use single quotes instead
}


Expand Down Expand Up @@ -60,7 +65,7 @@ static function build_html5_treelike_string( $html ) {
$output .= "<{$t}>\n";
}

return $output;
return [ "output" => $output, "error" => $p->get_last_error() ];

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

Short array syntax is not allowed

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "output" does not require double quotes; use single quotes instead

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "error" does not require double quotes; use single quotes instead

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

When a multi-item array uses associative keys, each value should start on a new line.
}

static function parse_html5_dat_testfile( $filename ) {

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

View workflow job for this annotation

GitHub Actions / PHP coding standards

Visibility must be declared on method "parse_html5_dat_testfile"
Expand Down

0 comments on commit 7843f2b

Please sign in to comment.