So recently I have been playing a lot with phing, symfony2, and Jenkins. Today I will show you how to build a very basic build script that runs phpunit. Future articles I will show you how to add to your build script to generate documentation and eventually integrate it all into Jenkins.
First we need to update our composer.json
file to include phing and phpunit if it is not already there.
Now we need to run the update command with composer to install the dependencies.
Awesome, now that we have both phing and phpunit, we can start on the build script.
NOTE: By default these are installed in vendor/bin
however, if you have changed this, they might be installed elsewhere. Composer Docs
In your project root directory, create a build.xml
and fill it with
This will now run phpunit by default. Give it a try by running php vendor/bin/phing
and it will run all your unit tests.
That’s all there is to it. In the next few articles I will show you some more in depth examples and configuring the Symfony2 test environment.