Hi everyone.

I've added a new branch to the testsuite SVN
(https://cakeforge.org/plugins/scmsvn/viewcvs.php/branches/?root=testsuite)
to create a more Rails-like approach to testing in CakePHP. There will
be little documentation until it is more solid and stable, but the
README.txt file in the repos does give some simple sample usage. The
tests can be run from the command line or a browser. Feel free to give
me a shout if needbe, as things will probably not work first time
(email or Spakman on #cakephp IRC).

It is simple and currently not up to production standards (to make it
work I had to modify some core classes and they haven't had enough work
to be solid - plus there are some issues and hacks in there!), but I
would *love* some feedback on the things I've got in there just now
(good, bad or indifferent). Also, if anyone has been doing anything
like this (that I've not found), please let me know. I'd hate to be
duplicating work.

Controller tests now inherit from the CakeControllerTest class, which
provides these methods in addition to the standard UnitTestCase ones:

cakeRequest($url, $variables = array()) - simulates an http request

assertResponse($status) - checks that a certain status code was
returned

assertTemplate($template) - checks that a certain template was rendered

assertRedirectedTo($url) - checks that redirect($url) was called

assigns($variable) - accesses the view $variable that is set in the
controller

session($variable) - accesses the session $variable that is set in the
controller

flash() - accesses the flash that is set in the controller

Next up, I would like to implement YAML fixtures and a proper testing
mode/environment. Check out some of the Rails documentation if you're
not familiar with this idea.

Any ideas/thoughts/abuse welcome!

Mark


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to