Install PHPUnit in Ubuntu

Hi friends, In this post I am going to explain how install PHPUnit in Ubuntu 12.04 , by following commands we can install it. First of we have to that what is PHPUnit and why we need to use it in PHP language?

PHPUnit is a unit testing software framework for the PHP programming language. Created by Sebastain Bergmann, PHPUnit is one of the xUnit family of frameworks that originated with Kent Beck’s SUnit. PHPUnit is hosted at GitHub. ( Credited by http://en.wikipedia.org/)

Install PHPUnit in Ubuntu by Anil Labs

There is list command to PHPUnit in Ubuntu

Command 1 :

sudo apt-get install php-pear

Command 2 :

sudo pear channel-update pear.php.net

Command 3 :

sudo pear upgrade-all

Command 4 :

sudo apt-get install phpunit

If you face any errors then install all dependencies

Command 5:

sudo pear upgrade pear

Command 6:

sudo pear channel-discover pear.phpunit.de

Command 7:

sudo pear channel-discover components.ez.no

Command 8:

sudo pear channel-discover pear.symfony.com

Command 9:

sudo pear install –alldeps phpunit/PHPUnit

Command 10:

phpunit –version

Output : PHPUnit 3.7.10 by Sebastian Bergmann.

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

1 Response

  1. bibin says:

    Nice article!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.