I just upgraded to [[LINK href="http://www.symfony-project.org/blog/2009/11/10/lime-2-alpha-released"]]Lime 2[[/LINK]] and I'm trying to write a functional test that uses annotations. I'm doing something wrong - its as if the annotations never get called. Can someone please post a working example, so I can see how its done?
<strong>Update</strong>: So, maybe this feature isn't used much? Can anyone post an actual example that they've written?
Gordon Franke answers:
i think it is not a good idea to use lime 2. Symfony 2 will use phpunit as test framework see https://gist.github.com/309820/59a86f8637e9ce85c17daf57317922f597c4569e and Symfony 2 will came at the end of the year 2010 see [[LINK http://www.slideshare.net/fabpot/symfony-20-revealed]]http://www.slideshare.net/fabpot/symfony-20-revealed[[/LINK]] slide 130.
You can also use PHPUnit in your symfony 1 projects see
Lawrence Krubner comments:
Ah, that is frustrating. I initially resisted using Lime because I didn't want to learn another testing framework. Then, finally, 6 months ago, I decided I should use it because using it was the official Symfony way of doing things. Now it is going away?
At least PHPUnit is solid.
Bernhard Schussek answers:
First of all, I never tested Lime 2 with functional tests and annotations (yet). So I cannot tell you exactly whether that will work.
To get Lime 2 working correctly with annotations, you need to do three things:
1) Load the LimeAutoloader
2) Register it
3) Enable annotation support
Then you are able to use annotations. Again, this is for unit tests, I'm not sure whether functional tests work out of the box with annotations. This was never tested by me.
$t = new LimeTest(2);
$fixture = new SomeClass();
// @Test: SomeClass behaves correctly if 1 == 1
$t->is($fixture->one(), 1, "1 is definitely 1");
// @Test: If 1 is not 1, SomeClass throws a WeirdMathsException
Christian Schaefer answers:
I have to second Gordon. Latest rumours show that Lime2 is dropped in favour of PHPUnit.
However I have to point out that lime and Lime2 are both for unit testing not functions tests!
For functional Tests you should use sfTestBrowser which has nothing to do with lime.
More can be read here: