diff --git a/README.md b/README.md index ac7fa99..14a3297 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,35 @@ # codeclimate-test-reporter -Collects test coverage data from your PHP test suite and sends it to +Collects test coverage data from your PHP test suite and sends it to Code Climate's hosted, automated code review service. Code Climate - https://codeclimate.com **Important:** If you encounter an error involving SSL certificates, see the **Known Issue: SSL Certificate Error** section below. +## Requirements + +There are several requirements you'll need in order to use the PHP test reporter on your system: + +- [PHPUnit](http://phpunit.de) +- [Xdebug](http://xdebug.org) +- [Composer](http://getcomposer.org) + +The test reporter uses the [PHPUnit](http://phpunit.de) testing tool to generate [code coverage](http://en.wikipedia.org/wiki/Code_coverage) information. These results show how much of your application's code is being executed by your unit tests. PHPUnit can't generate this information on it's own though - it needs another tool, [Xdebug](http://xdebug.org). This is *not* included as a part of the PHPUnit (or PHP) install by default so you'll need to install it yourself. + +Xdebug is installed as an extension to PHP, not a library. You can find more information about installing the tool via PECL [on the project website](http://xdebug.org/docs/install). + +If you execute your PHPUnit tests with the `--coverage-clover` option and receive the message "The Xdebug extension is not loaded. No code coverage will be generated." you will need to visit the Xdebug website and install the extension. If you do not, you'll most likely get an error something like this: + +``` +PHP Warning: simplexml_load_file(): I/O warning : failed to load external entity "[...]/build/logs/clover.xml" in [...]/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 52 +``` + ## Installation -This package requires a user, but not necessarily a paid account, on -Code Climate, so if you don't have one the first step is to signup at: +This package requires a user, but not necessarily a paid account, on +Code Climate, so if you don't have one the first step is to signup at: https://codeclimate.com. To install php-test-reporter with Composer run the following command. @@ -50,18 +68,18 @@ Or invoke `phpunit` as follows: $ phpunit --coverage-clover build/logs/clover.xml ``` -- Specifying your repo token as an environment variable, invoke the +- Specifying your repo token as an environment variable, invoke the test-reporter: ``` $ CODECLIMATE_REPO_TOKEN="..." vendor/bin/test-reporter ``` -The `CODECLIMATE_REPO_TOKEN` value is provided after you add your repo -to your Code Climate account by clicking on "Setup Test Coverage" on the +The `CODECLIMATE_REPO_TOKEN` value is provided after you add your repo +to your Code Climate account by clicking on "Setup Test Coverage" on the right hand side of your feed. -Please contact hello@codeclimate.com if you need any assistance setting +Please contact hello@codeclimate.com if you need any assistance setting this up. ## Known Issue: SSL Certificate Error @@ -83,7 +101,7 @@ More details can be found in [this issue][issue]. ## Contributions -Patches, bug fixes, feature requests, and pull requests are welcome on +Patches, bug fixes, feature requests, and pull requests are welcome on the GitHub page for this project: https://github.com/codeclimate/php-test-reporter @@ -94,6 +112,6 @@ This package is maintained by Bryan Helmkamp (bryan@codeclimate.com). See LICENSE.txt -Portions of the implementation were inspired by the php-coveralls +Portions of the implementation were inspired by the php-coveralls project. diff --git a/composer.json b/composer.json index 830dbb0..fbded47 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "symfony/console": ">=2.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*@stable" + "phpunit/phpunit": "3.7.*@stable", + "ext-xdebug": "*" }, "autoload": { "psr-0": {