After some more testing I found the cause of the problem. My layout contains
a small snippet of javascript:

<script type="text/javascript">
//<![CDATA[
document.write('<a href="?enhanced=1" class="switch_modes">Switch to
Enhanced Mode</a>');
//]]>
</script>

As you can see, the script body is properly enclosed in a CDATA section, but
it seems that Zend_Dom_Query insists on interpreting the script as HTML.
Removing the document.write() line allows the unit tests to run and pass.

I'm still not sure why this works fine in 1.10.0 but not 1.10.1. I'm going
to take a look at the diff to see what has changed to see if I can correct
this.

If anyone has any pointers or suggestions, let me know. I would prefer to
not have to create a one-line javascript file.

--
Hector


On Tue, Feb 16, 2010 at 2:49 PM, Hector Virgen <[email protected]> wrote:

> Is anyone else experiencing problems with
> Zend_Test_PHPUnit_ControllerTestCase#assertQuery() in 1.10.1?
>
> In 1.10.0, my unit tests were passing successfully, but after upgrading to
> 1.10.1, all of my assertQuery() tests result in the same error:
>
> 1) UsersControllerTest::testNotLoggedInOnLoginPageDoesNotCauseRedirection
> DOMDocument::loadHTML(): Unexpected end tag : a in Entity, line: 30
>
>
> /Users/hvirgen/Web/library/ZendFramework-1.10.1/library/Zend/Dom/Query.php:186
>
> /Users/hvirgen/Web/library/ZendFramework-1.10.1/library/Zend/Dom/Query.php:160
>
> /Users/hvirgen/Web/library/ZendFramework-1.10.1/library/Zend/Test/PHPUnit/Constraint/DomQuery.php:157
>
> /Users/hvirgen/Web/library/ZendFramework-1.10.1/library/Zend/Test/PHPUnit/ControllerTestCase.php:290
>
> /Users/hvirgen/Web/projects/datadirector3/tests/application/controllers/UsersControllerTest.php:17
>
> I have verified that the response body is valid XHTML, so I'm not sure why
> it's saying there's a broken anchor.
>
> --
> Hector
>

Reply via email to