-- Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 July 2008, 07:27 AM -0400):
> -- Tuan Ngo <[EMAIL PROTECTED]> wrote
> (on Tuesday, 08 July 2008, 12:01 PM +0700):
> > On Mon, Jul 7, 2008 at 6:21 PM, Matthew Weier O'Phinney <[EMAIL PROTECTED]>
> > wrote:
> > > Third, after making those changes, try running the following:
> > >
> > >    phpunit -d 'display_errors=1' -d 'error_reporting=8191'
> > SearchControllerTest
> > >
> > > and see if you get any error messages. Send the output of running that
> > > command to the list.
> > >
> > > Fourth, can you indicate what version of PHP you're using?
> > >
> > > Finally, can you send your test class? I may be able to better diagnose
> > > by looking at some representative code.
> > This morning, I try to reproduce this issue on a small example code which I
> > attached in this mail. I still face the same issue with :
> > phpunit -d 'display_errors=1' -d 'error_reporting=8191' SearchControllerTest
> > OR
> > phpunit SearchControllerTest
> > 
> > I run test on
> > - my dev box which is : Ubuntu8.04, PHP Version => 5.2.4-2ubuntu5.1
> > - test server which is CentOS5, PHP Version => 5.1.6
> > 
> > I also check that the jsonAction, htmlAction work well when request from
> > browser.
> 
> I'll run this in the next few hours and see what I can find -- thanks
> for providing the code.
> 
> > Anyway, beyond the json issue. I face another issue about exception. It 
> > seems
> > that if the dispatch process raises an exception due to wrong action name 
> > for
> > example, I can't catch that exception by using @expectedException
> > ExceptionClassName as normal. But if I manually throw an exception in action
> > code, I can.
> > 
> > I also add test code about exception in attached code.
> 
> Are you by any chance disabling the ErrorHandler plugin? I've personally
> tested for both non-existent actions and controllers with success.
> Additionally, @expectedException would not work with this, as the
> dispatcher is already catching exceptions thrown in the application
> layer and pushing them into the response.

Okay, found a few issues that I've now fixed:

 * The JSON action helper exits by default, but has a flag that can be
   set to prevent this. I've modified the test case to set this flag.

 * __set() was interfering with some PHPUnit internal mechanisms. I've
   fixed that now as well. 

Running your tests now, I get errors -- looks like you may need to
create an ErrorController. Otherwise, the output works correctly. Please
update from svn, and try again!

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to