Wednesday, 13 February 2013

PHPUnit Installation in Windows - Wamp using PEAR

To Install PHPUnit in Windows, we have to follow below listed steps.

Step1: Install PEAR
  1. Download "go-pear.phar" from http://pear.php.net/go-pear link
  2. If incase the above link shows any problem use http://pear.php.net/go-pear.phar link
  3. Create "pear" folder in PHP Location [Example: C:\wamp\bin\php\php5.3.8\]
  4. Place downloaded "go-pear.phar" file in the "pear" folder
  5. Open Command Prompt and execute below command
    1. Click on "Start Menu" on task bar and type "cmd" in run
    2. In the command prompt move to PHP Location [Example: C:\wamp\bin\php\php5.3.8]
    3. Execute "php .\pear\go-pear.phar" command

    1. Installation will begin.
    2. During installation process, we’ll be prompted with some messages / questgions.
    3. Just hit enter when necessary.

  1. Just Press "Y" in case of Question Prompts

   
  

    1. After installing, double-click and instal “PEAR_ENV.reg” found in PHP Location [Example: C:\wamp\bin\php\php5.3.8\].
    2. Run pear upgrade-all from PHP Location [Example: C:\wamp\bin\php\php5.3.8\]

Step2: Run Below listed Pear Commands
  1. Run below listed commands from PHP Location [Example: C:\wamp\bin\php\php5.3.8\]
    1. pear channel-discover components.ez.no
    2. pear channel-discover pear.phpunit.de
    3. pear channel-discover pear.symfony-project.com
    4. pear install --alldeps phpunit/PHPUnit

If something goes wrong with the above pear commands we should run “pear clear-cache” command to make sure that the installer does not use cached data from PHP Location [Example: C:\wamp\bin\php\php5.3.8\].

Step3: Install PHPUnit
  1. Run pear install –alldeps phpunit/PHPUnit from PHP Location [Example: C:\wamp\bin\php\php5.3.8\]
  2. If we met with any problem running above command, we can try the below. 
    1. pear install --force –alldeps phpunit/PHPUnit
  3. After Installation, check the PHPUnit Version.
    1. Run phpunit --version command from PHP Location [Example: C:\wamp\bin\php\php5.3.8\]


No comments:

Post a Comment

Thank you so much for providing your valuable feedback. I will will look into them and update my skills & technologies accordingly.