Saturday, December 8, 2012

Debug not working in CakePHP 2 test cases ?

From the past few months, i have been involved in a lot of Test Driven Development with CakePHP 2. It uses an excellent tool called PHPUnit for TDD. A major source of irritation for me was the debug function not working in case you need to see the output of something. The framework swallows the debug output and does not show anything. And if you are like me who prefers running test cases from the browser instead of console, this tip is for you. While running your test cases, call ob_flush() after the debug statement.
debug($this->request->data);
ob_flush();
Hope this post was helpful for folks out there.

No comments:

Post a Comment