Testing a cake – what’s missing?

Published on and tagged with cakephp  testing

In the last few days I discussed with several people about (unit) testing in CakePHP. The result is that testing with CakePHP is not as easy as it should be (not really a surprise if you ever tried to write tests *g*), and that some features are missing. So here my current todo list for the test suite:

  • Restructure tests folder
  • Command line support
  • Fixtures for model tests
  • Make it easier to test controllers (it is a bit spongy, I know)

Other ideas? Wishes? Please let me know :)

5 comments baked

  • teemow

    it would be nice to integrate javascript testing with the test suite. i’ve done this by just passing the javascript test file to the jsunit testing app. also having a test suite which is a little bit more mvc. it’s hard to brand the test suite :)

    as i already mentioned at felix’ blog and in the google group i would like to help refactoring the test suite.

  • cakebaker

    @teemow: Yes, integrated javascript testing would be nice. You can join the testsuite project on cakeforge: http://cakeforge.org/projects/testsuite/

  • jon baer

    +1 for javascript testing

    what id like to see is automated fixtures for “junking” a database .. like if you have a db w/ (id int, title varchar(100), post text, entered timestamp), id like to have a command line to through N random records at it to fill up the database easily and quickly.

    id like to think a script of some kind already exists for this, anyone know?

    thanks!

  • george

    Having fixtures is quite important. The way they are realized in rails is just the way to go

  • cakebaker

    @jon baer: Good idea.

    There exist some commercial products, search for “test data generator”.

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License