Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

assertTag - content - isHTML -failed #763

Closed
pjsb opened this Issue · 2 comments

3 participants

@pjsb

I tried to test my framework, which generates HTML. The assertTag is wonderfull to check it, but it fails in some cases, see below.

Does assertTag do any HTML validation too? I know that some examples are invalid html, therefore I set isHTML to skip maybe any HTML validation to false, but with the same result.

1) RenderTest::testRender with data set #9 ('area', false, '<area>SomeText</area>')
Failed asserting that false is true.


2) RenderTest::testRender with data set #19 ('param', false, '<param>SomeText</param>')
Failed asserting that false is true.


3) RenderTest::testRender with data set #34 ('base', false, '<base>SomeText</base>')
Failed asserting that false is true.


4) RenderTest::testRender with data set #36 ('head', false, '<head>SomeText</head>')
Failed asserting that false is true.


5) RenderTest::testRender with data set #40 ('script', false, '<script>SomeText</script>')
Failed asserting that false is true.


6) RenderTest::testRender with data set #41 ('style', false, '<style>SomeText</style>')
Failed asserting that false is true.


7) RenderTest::testRender with data set #44 ('col', false, '<col>SomeText</col>')
Failed asserting that false is true.´´´

EDIT: Ok after fixing self closing tags, there are only two issues

1) RenderTest::testRender with data set #40 ('script', false, false, '<script>SomeText</script>')
Failed asserting that false is true.


2) RenderTest::testRender with data set #41 ('style', false, false, '<style>SomeText</style>')
Failed asserting that false is true.

But the question is the same? HTML validation? Does it validate the innerHTML also? Even if isHTML set to false?

Edit by @edorian: Fixed markdown

@edorian
Collaborator

Hi :)

isHtml = false means it's loaded as xml.

In both cases libxml_errors are used an reported on. (If we don't get valid dom documents we can't compare things in assertTag).

If you believe there is an issue I'd need a working reproduce case with your expectation but assertTag won't do comparisons on invalid/even-unloadable-by-the-crazy-flexible-dom-document-libxml-loader stuff.

@whatthejeff
Collaborator

This is a bug. PHPUnit_Util_XML::getNodeText() does not account for CDATA sections.

@whatthejeff whatthejeff closed this issue from a commit
@whatthejeff whatthejeff Fixes #763
 * `assertTag()` fails to match content in CDATA sections.
2c67e52
@cspray cspray referenced this issue from a commit
@whatthejeff whatthejeff Fixes #763
 * `assertTag()` fails to match content in CDATA sections.
ef35ab2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.