Tuesday, December 20, 2011

Re: What's all this SQL being run when running a controller unit test plan?

Those queries are generated by the fixtures in your app, those classes generate fake model data in separate tables in order to test the features safely. Although if you did not know about it, then those queries are being run on your main database!! (with a table prefix in order to preserve the originals). While this can be considered "secure" I encourage you to create a different database setup for the tests.

The latter is achieved by setting the "$test" config in database.php

Each test in your suite will create the tables, fill the data and drop them again.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: