Installing PHPUnit On Windows With Out PEAR

This is a quick description of how I got PHPUnit working on Windows without installing PEAR

The PHPUnit documentation is a cryptic and sparse when describing how to install PHPUnit on windows.

I am assuming that PHP is already installed and working.

Steps:

  1. Download the latest version of PHPUnit (currently 3.4.9) from here http://pear.phpunit.de/get/
  2. Extract to somewhere (I put it in my PHP directory)
  3. Edit the phpunit.bat file. At the bottom of the file there are two lines:
    set PHPBIN="@php_bin@"
    %PHPBIN% "@bin_dir@\phpunit" %*
  4. Change them to something like this:
    set PHPBIN="C:\Program Files (x86)\PHP\php.exe"
    %PHPBIN% "C:\Program Files (x86)\PHP\phpunit.php" %*
  5. To test if PHPUnit is working run “phpunit --help” from a command  prompt (PHP directory needs to be set in the path environment variable).
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: