Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

assertTag - content - isHTML -failed #763

Closed
pjsb opened this Issue Dec 31, 2012 · 2 comments

Comments

Projects
None yet
3 participants

pjsb commented Dec 31, 2012

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

Contributor

edorian commented Jan 4, 2013

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.

Contributor

whatthejeff commented Mar 11, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment