4. Cookbook
4.1. Usage with symfony 1.4
If you want to use atoum inside a symfony 1.4 project, the sfAtoumPlugin is available at the following adress : https://github.com/atoum/sfAtoumPlugin.
4.2. Installation
There is many ways to install the plugin in your project :
- via composer
- via git submodules
4.2.1. Using composer
Add this in your composer.json :
"require" : { "atoum/sfAtoumPlugin": "*" },
After a php composer.phar update the plugin should be in the plugin folder and atoum in the vendor folder.
Then in your ProjectConfiguration file you have to activate the plugin and define the atoum path.
if (sfConfig::get('sf_environment') != 'prod') { $this->enablePlugins('sfAtoumPlugin'); }
4.2.2. Using a git submodule
Install atoum as a submodule
git submodule add git://github.com/atoum/atoum.git lib/vendor/atoum
Install sfAtoumPlugin as a git submodule
git submodule add git://github.com/atoum/sfAtoumPlugin.git plugins/sfAtoumPlugin
Add the plugin in your ProjectConfiguration file
if (sfConfig::get('sf_environment') != 'prod') { $this->enablePlugins('sfAtoumPlugin'); }
4.3. Write tests
Tests must include the bootstrap :
require_once __DIR__ . '/../../../../plugins/sfAtoumPlugin/bootstrap/unit.php';
4.4. Launch tests
You can launch tests with this symfony command :
./symfony atoum:test
You can pass a configuration any atoum configuration, so for example, you can pass a configuration file like this :
php symfony atoum:test -c config/atoum/hudson.php