Skip to content
This repository
Browse code

Update installation instructions.

  • Loading branch information...
commit d4a08a264f268891a27a5fe4bf57ff27d11e9325 1 parent ed9f20d
Sebastian Bergmann authored October 09, 2012

Showing 1 changed file with 30 additions and 19 deletions. Show diff stats Hide diff stats

  1. 49  README.md
49  README.md
Source Rendered
... ...
@@ -1,30 +1,43 @@
1  
-PHPUnit
2  
-=======
  1
+# PHPUnit
3 2
 
4 3
 PHPUnit is the de-facto standard for unit testing in PHP projects. It provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.
5 4
 
6  
-Requirements
7  
-------------
  5
+## Requirements
8 6
 
9 7
 * PHPUnit 3.7 requires PHP 5.3.3 (or later) but PHP 5.4.6 (or later) is highly recommended.
10 8
 * [PHP_CodeCoverage](http://github.com/sebastianbergmann/php-code-coverage), the library that is used by PHPUnit to collect and process code coverage information, depends on [Xdebug](http://xdebug.org/) 2.0.5 (or later) but Xdebug 2.2.1 (or later) is highly recommended.
11 9
 
12  
-Installation
13  
-------------
  10
+## Installation
14 11
 
15  
-PHPUnit should be installed using the PEAR Installer, the backbone of the [PHP Extension and Application Repository](http://pear.php.net/) that provides a distribution system for PHP packages.
  12
+There a three supported ways of installing PHPUnit.
16 13
 
17  
-Depending on your OS distribution and/or your PHP environment, you may need to install PEAR or update your existing PEAR installation before you can proceed with the following instructions. `sudo pear upgrade PEAR` usually suffices to upgrade an existing PEAR installation. The [PEAR Manual ](http://pear.php.net/manual/en/installation.getting.php) explains how to perform a fresh installation of PEAR.
  14
+You can use the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) or [Composer](http://getcomposer.org/) to download and install PHPUnit as well as its dependencies. You can also download a [PHP Archive (PHAR)](http://php.net/phar) of PHPUnit that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file.
  15
+
  16
+### PEAR Installer
18 17
 
19 18
 The following two commands (which you may have to run as `root`) are all that is required to install PHPUnit using the PEAR Installer:
20 19
 
21 20
     pear config-set auto_discover 1
22 21
     pear install pear.phpunit.de/PHPUnit
23 22
 
24  
-After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually `/usr/lib/php/PHPUnit`.
  23
+### Composer
  24
+
  25
+To add PHPUnit as a local, per-project dependency to your project, simply add a dependency on `phpunit/phpunit` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a development-time dependency on PHPUnit 3.7:
  26
+
  27
+    {
  28
+        "require-dev": {
  29
+            "phpunit/phpunit": "3.7.*"
  30
+        }
  31
+    }
  32
+
  33
+### PHP Archive (PHAR)
  34
+
  35
+You can also download a PHP Archive (PHAR) of PHPUnit that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file:
  36
+
  37
+    wget http://pear.phpunit.de/get/phpunit.phar
  38
+    chmod +x phpunit.phar
25 39
 
26  
-Documentation
27  
--------------
  40
+## Documentation
28 41
 
29 42
 The documentation for PHPUnit is available in different formats:
30 43
 
@@ -41,22 +54,20 @@ The documentation for PHPUnit is available in different formats:
41 54
 * [Japanese, PDF](http://www.phpunit.de/manual/3.7/ja/phpunit-book.pdf)
42 55
 * [Japanese, ePub](http://www.phpunit.de/manual/3.7/ja/phpunit-book.epub)
43 56
 
44  
-IRC
45  
----
  57
+## IRC
46 58
 
47 59
 The [#phpunit channel on the Freenode IRC network](irc://irc.freenode.net/phpunit) is a place to chat about PHPUnit.
48 60
 
49  
-List of Contributors
50  
---------------------
  61
+## List of Contributors
51 62
 
52 63
 Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components:
53 64
 
54  
-- [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors)
55  
-- [PHP_CodeCoverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors)
56  
-- [PHPUnit_MockObject](https://github.com/sebastianbergmann/phpunit-mock-objects/graphs/contributors)
  65
+* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors)
  66
+* [PHP_CodeCoverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors)
  67
+* [PHPUnit_MockObject](https://github.com/sebastianbergmann/phpunit-mock-objects/graphs/contributors)
57 68
 
58 69
 A very special thanks to everyone who has contributed to the documentation and helps maintaining the translations:
59 70
 
60  
-- [PHPUnit Documentation](https://github.com/sebastianbergmann/phpunit-documentation/graphs/contributors)
  71
+* [PHPUnit Documentation](https://github.com/sebastianbergmann/phpunit-documentation/graphs/contributors)
61 72
 
62 73
 Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects.

0 notes on commit d4a08a2

Please sign in to comment.
Something went wrong with that request. Please try again.