File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
dev/tests/integration/testsuite/Magento/PageBuilder/Plugin/Filter Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ protected function setUp()
47
47
public function testFiltering (string $ preFiltered , string $ postFiltered , string $ preFilteredBasename )
48
48
{
49
49
$ this ->assertEquals (
50
- $ postFiltered ,
51
- $ this ->templateFilter ->filter ($ preFiltered ),
50
+ $ this -> formatHtml ( $ postFiltered) ,
51
+ $ this ->formatHtml ( $ this -> templateFilter ->filter ($ preFiltered) ),
52
52
"Failed asserting that two strings are equal after filtering $ preFilteredBasename "
53
53
);
54
54
}
@@ -79,4 +79,15 @@ public function filterDataProvider(): array
79
79
80
80
return $ dataProviderArgs ;
81
81
}
82
+
83
+ /**
84
+ * Strip whitespace from the HTML to conduct a fairer comparison
85
+ *
86
+ * @param string $html
87
+ * @return string|string[]|null
88
+ */
89
+ private function formatHtml (string $ html ): string
90
+ {
91
+ return preg_replace ('/(?<=>)\s+|\s+(?=<)/m ' , '' , $ html );
92
+ }
82
93
}
You can’t perform that action at this time.
0 commit comments