I am using PHPUnit 3.5 and CIUnit with PHING 2.4 for unit testing my CodeIgniter controller functions
The problem is when the function i tested contains a redirect() function, the testcase will stop and will not continue the execution. There is also no available error log for this.
What could be the problem for this? Do i have to download/update PHPUnit specific library?
Any suggestion would be greatly appreciated.
Thanks
Well this would be because the
redirect()fn exits after doing a redirect (which is what you should be doing when you do a redirect to stop further code execution while waiting on the browser redirect)./system/helpers/url_helper.php:
The only way ‘around’ this is to eliminate the
exit;after the redirect call.Ref: http://codeigniter.com/user_guide/helpers/url_helper.html