Closed RoSk0 closed 2 years ago
Force pushed to fix expected data.
Expect test to fail with:
1) test\Ingenerator\BehatTableAssert\TableParser\HTML\HTMLStringTableParserTest::test_it_parses_table_node_from_valid_html_table with data set "Table with a "time" element" ('<table><thead><tr><td>Header<...table>', array(array('Header', 'Date'), array('Cell1', '30 Aug 2016')))
InvalidArgumentException: Invalid HTML string:
#801:Tag time invalid (@1:229)
@RoSk0 that's a brilliant addition with the dataset names, I'd never noticed phpunit had that feature, will help us a lot!
Unfortunately I don't see a way to solve this without refactoring the library to use a third-party html5 parser. Realistically, we don't have time to do that from our end.
If you would like to work on that I'd consider merging it - it might be worth looking at masterminds/html5
which I've seen people using...
Surprisingly I was working on a proof of concept using it.
And here you go - all green locally!
That's fantastic, thanks.
The only thing I've had to do is bump the minimum masterminds/html5 version to 2.7.5 as it looks like they have issues on 8.1 before that.
Interesting ...
Tests are failing because they are using the lowest
versions . Locally I had 2.7.6
installed by the constraint from composer.json
.
I would recommend adding additional test runs to the matrix, with the --prefer-lowest
instruction , to pick up upcoming issues.
@RoSk0 as per #19 we're already covering both --lowest and default, so the runs with 2.7.6 passed but 8.1:lowest failed until I bumped the minimum requirement to 2.7.5. All good now.
Table that I need to test contains
time
element andDOMDocument::loadHTML()
fails to parse it.Also, I allowed myself to add a small improvement in the first commit - used comments as names for datasets. This is recommended to improve readability when tests fail.