Re: Cake debugging and testing
They might, but worst case scenario you just buffer the output. I'm not experienced enough with SimpleTest, but I know they have assertion methods that let you check the page output for certain substrings or test expressions, as well as checking for certain HTTP headers. http://www.lastcraft.com/web_tester_documentation.php That has some docs on doing remote web testing, which may work for you as well, just give it a local address. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake debugging and testing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Awesome. Thank you. Calls to render() and flash() inside of the controller action don't screw this up? nate wrote: > Here's an example: > /app/tests/app/cases/controllers/comments_controller.test.php: > > require CONTROLLERS . 'comments_controller.php'; > > class CommentsControllerTestCase extends UnitTestCase { > > function setUp() { > $this->comments = new CommentsController(); > $this->comments->constructClasses(); > } > > function testCommentsIndexData() { > $this->comments->index(2); > $this->assertTrue(!empty($this->comments->_viewVars)); > > $this->assertTrue(isset($this->comments->_viewVars['comments'])); > } > } > > Note that you need to have the test suite installed per the tutorial on > the wiki. > > > > - -- Darian Anthony Patrick <[EMAIL PROTECTED]> -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFK+HRKpzEXPWA4IcRAuEEAJ40nCdjNWv+TNiki03ARqPVFsUBawCaAjBc /84bCnM5SjZjFfuhWMp+PH8= =uwGi -END PGP SIGNATURE- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake debugging and testing
Here's an example: /app/tests/app/cases/controllers/comments_controller.test.php: require CONTROLLERS . 'comments_controller.php'; class CommentsControllerTestCase extends UnitTestCase { function setUp() { $this->comments = new CommentsController(); $this->comments->constructClasses(); } function testCommentsIndexData() { $this->comments->index(2); $this->assertTrue(!empty($this->comments->_viewVars)); $this->assertTrue(isset($this->comments->_viewVars['comments'])); } } Note that you need to have the test suite installed per the tutorial on the wiki. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake debugging and testing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nate, Are there more in-depth examples of unit testing controller actions? I'm speaking specifically about using direct calls on the action methods (which I'm not doing right now), rather than using the HTTP request instantiation capabilities of Simpletest (which I _am_ doing right now). Darian nate wrote: > You can set breakpoints in your Cake application in an IDE like Zend. > I still do it sometimes. Also, if you download and install Cake's unit > test suite off of CakeForge, Bake will generate unit test files for > your controllers and models when you bake them, and the interface for > testing apps makes it quite easy. > > > > - -- Darian Anthony Patrick <[EMAIL PROTECTED]> -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFK79bKpzEXPWA4IcRAu6iAJ9+Sr04tW3LTXrJPzFemaXDH6UnagCeNVjd LG7POORw4xBsaK31Wii4QIs= =qeq6 -END PGP SIGNATURE- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake debugging and testing
Thanks a lot for the info nate :)Marcelo.On 10/10/06, nate <[EMAIL PROTECTED]> wrote: You can set breakpoints in your Cake application in an IDE like Zend.I still do it sometimes. Also, if you download and install Cake's unit test suite off of CakeForge, Bake will generate unit test files foryour controllers and models when you bake them, and the interface fortesting apps makes it quite easy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake debugging and testing
You can set breakpoints in your Cake application in an IDE like Zend. I still do it sometimes. Also, if you download and install Cake's unit test suite off of CakeForge, Bake will generate unit test files for your controllers and models when you bake them, and the interface for testing apps makes it quite easy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Cake debugging and testing
Cake has some advantages when it comes to debugging such as the debug level feature and other helper functions. However, I can't imagine running a Cake app over a breakpoint-like php debugger mainly becouse of the architecture of the framework. Is it right? Also, how does Unit testing relates to Cake? Is it viable to do unit testing o Cake-powered apps?Thanks in advance,Marcelo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---