0

I'm trying to write some unit tests in Lime but the list of valid test methods in the documentation seems to be rather limited:

http://www.symfony-project.org/jobeet/1_4/Doctrine/en/08

I'm trying to write a number of tests which attempt to save a model with incorrect values.

Does Lime have a method that will work correctly for this?

A quick google on the topic brought up nothing useful.

Surely there must be an easy way to do this?

Any advice appreciated.

Thanks.

Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34
Dan
  • 3,041
  • 2
  • 17
  • 9
  • I believe you want functional testing, not unit testing. Unit testing in symfony is generally aimed at classes/functions that you write yourself. – Patrick Mar 02 '11 at 21:19
  • In my experience the Lime test methods are in fact limited. I'm confused as to why the symfony team would roll their own and not use PHPUnit, but maybe they explain somewhere. I'm currently testing sfPHPUnit2Plugin; so far so good, although it's hard to namespace your tests for e.g. widget, model, etc - there's no task to run a subset of unit tests, only all tests or a single one. – yitznewton Mar 03 '11 at 16:34

1 Answers1

1

Here is a good article about unit testing database model. Found it very useful myself. It also recommends doing model tests in an in-memory sqlite database, which is much faster than using mysql database.

http://webmozarts.com/2010/03/11/writing-efficient-tests/

georgelx
  • 474
  • 3
  • 9