Although there is a good tutorial about PHPunit and Magento integration and I’d rather using Lime ( the symfony-integrated test engine ) here I’ll show you how to set up PHPUnit tests in order to improve the QA of your Magento customizations.

I’m working on Ubuntu Jaunty, so a few steps might be different based on your OS: nevermind, with a bit of patience you’ll be able to set up your environment correctly.

First of all let’s install PHPUnit from the repo:

1

sudo apt-get install phpunit

You can decide to download PHPUnit from its official website and run a single installation under a magento directory: I prefer having PHPUnit running in my whole environment because I want to test different applications, so I don’t have to re-install PHPunit for all of them.