Skip to content
Snippets Groups Projects
Commit c069f5f9 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2441583 by daffie: Upgrade Drupal\views\Tests\Plugin\StyleTestBase to HTML5

parent d64047e3
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Drupal\views\Tests\Plugin; namespace Drupal\views\Tests\Plugin;
use Drupal\views\Tests\ViewUnitTestBase; use Drupal\views\Tests\ViewUnitTestBase;
use Masterminds\HTML5;
/** /**
* Tests some general style plugin related functionality. * Tests some general style plugin related functionality.
...@@ -25,8 +26,8 @@ abstract class StyleTestBase extends ViewUnitTestBase { ...@@ -25,8 +26,8 @@ abstract class StyleTestBase extends ViewUnitTestBase {
* Stores a view output in the elements. * Stores a view output in the elements.
*/ */
function storeViewPreview($output) { function storeViewPreview($output) {
$htmlDom = new \DOMDocument(); $html5 = new HTML5();
@$htmlDom->loadHTML($output); $htmlDom = $html5->loadHTML('<html><body>' . $output . '</body></html>');
if ($htmlDom) { if ($htmlDom) {
// It's much easier to work with simplexml than DOM, luckily enough // It's much easier to work with simplexml than DOM, luckily enough
// we can just simply import our DOM tree. // we can just simply import our DOM tree.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment