ZF-12113: Zend_Test error messages should be more verbose

Issue Type: Improvement Created: 2012-03-22T08:47:11.000+0000 Last Updated: 2012-05-31T19:37:58.000+0000 Status: Resolved Fix version(s): Reporter: Martin Hujer (mhujer) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Test_PHPUnit

  • FixForZF1.12
  • zf-crteam-review

Related issues: Attachments: - Redirect.php.patch


It shows messages just like this ```. This makes tests hard to debug.

It would be nice to show also the actual value (the way standard PHPUnit asserts work - they show expected and actual value).


Posted by Martin Hujer (mhujer) on 2012-03-23T12:18:15.000+0000

Patch for Zend_Test_PHPUnit_Constraint_Redirect

<pre class="highlight">
There were 4 failures:

1) ZfControllerTest::testRedirectTo
Failed asserting response redirects to "/user/login/?red=foo"
It redirects to "/user/login/?red=%2Fuser%2Forders%2F".

2) ZfControllerTest::testNotRedirect
Failed asserting response is NOT a redirect
It redirects to "/user/login/?red=%2Fuser%2Forders%2F"

3) ZfControllerTest::testRedirectRegex
Failed asserting response redirects to URL MATCHING "~^[a-z].$~"
It redirects to "/user/login/?red=%2Fuser%2Forders%2F".

4) ZfControllerTest::testNotRedirectRegex
Failed asserting response DOES NOT redirect to URL MATCHING "~[a-z].*~"
It redirects to "/user/login/?red=%2Fuser%2Forders%2F".

Posted by Martin Hujer (mhujer) on 2012-03-23T12:30:36.000+0000

Patch for Zend_Test_PHPUnit_Constraint_ResponseHeader (only for assertResponseCode method)

<pre class="highlight">
There was 1 failure:

1) ZfControllerTest::testResponseCode
Failed asserting response code "404"
Was "200"

Posted by Martin Hujer (mhujer) on 2012-05-05T07:59:48.000+0000

Do you think we can have this in 1.12? I hate having to maintain our patched ZF.

Posted by Rob Allen (rob) on 2012-05-31T19:37:58.000+0000

Fixed in SVN r24851.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.