Is there a standard way of separation and functional tests for a Symfony2 application?

I have a Symfony2 application with unit and function tests, and I wondered if there is a common practice for separating unit and function tests so that I don't have the overhead of compiling the configuration, etc. whenever I ran a test suite? The unit test set should not depend on the availability of the database or the specific configuration. I was thinking about using a naming pattern to disambiguate the functional tests, or somehow create two different sets of tests, excluding the Tests / Controller directory in the kit, and the other, including this template.

Is this a problem shared by someone else, and what answers have you come to? Does anyone else share my opinion that, whenever possible, unit and functional tests in Symfony2 applications should ideally be separated by default?

+3
source share
1 answer

Usually people use different tools for unit and acceptance / functional tests: PHPUnit for the former and Behat for the latter. With Behat, you will have your tests in the namespace Featuresand run them with the command app/console -e=test behat, and PHPUnit with the command phpunit. FOSCommentBundleis an example of this.

Behat , , Tests Test .

+2

All Articles