When we want to start with unit testing in PHP, we need a tool that is called
PHPUnit. When PHPUnit is installed, we can start loading tests with the phpunit
command in the command line.
Before installing PHPUnit, make sure PEAR is installed on your server. If it is not done, you can do this by running the following command:
sudo apt-get install php-pear
You can also install it using a file. You can find information about this procedure by navigating to the following URL:
Follow the next steps to install PHPUnit on your development server:
To install PHPUnit, we have to use a custom PEAR channel. We need to register the PHPUnit PEAR channel before we can install PHPUnit over PEAR. With the next command, we will add the extra channel to the PEAR environment:
sudo pear channel-discover pear.phpunit.de
The PHPUnit channel depends on some other channels. We need to discover the channel
components.ez.no...