themouette edited this page Nov 23, 2011 · 12 revisions


The main idea of the plugin is to integrate phpunit and symfony more closer.
Make the process of test writing more standard, flexible and easy for symfony developers.
Another idea is to allow developers use features that only they want and not to inflict any extra requirments.

There are some main features.

  • Flexible way to store and run tests.
  • Manage fixtures, separate them to different folders.
  • Manage symfony contexts.
  • Configure phpunit in a symfony configuration way.
  • Create testing infrastructure in one touch.
  • Provide custom TestCases, for example, SeleniumTestCase, AmfTestCase.

Example project

We made a sendbox project with some unit and functional tests.
Also there is a lot of snapshots in project doc directory.
You can checkout the project:

  svn checkout


  • Symfony 1.2.x – 1.4.x
  • PHPUnit 3.4.x (also works with 3.3.x but there might be some bugs)
  • SabreAMF for amf testing (optional).
  • Selenium for functionals testing (optional).
  • Mysql 5.x or Oracle 10g RDBMS


  1. download:
    1. pear package

      php symfony plugin:install sfPhpunitPlugin
    2. svn tag

      svn checkout
    3. git version(development):

      git clone
  2. enable it in ProjectConfiguration:
        class ProjectConfiguration extends sfProjectConfiguration
            public function setup()
                $env = sfConfig::get('sf_environment');
                // Enviornment is not loaded at this point when run from CLI
                if ( $env === 'test' || php_sapi_name() === 'cli' ) {


The plugin infrastructure
Test Running
Eclipse PDT
Suite Handling
Context Managing
Config backup
Custom TestCases
Stubs data
Plugins testing
Good practices


Any feedbacks with ideas, bugs, misunderstandings, troubles are very welcome.


I want to say a big thank the whole FormaPro company.
The people from there use the plugin from very early versions and gives me very valuable feedbacks.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.