-#Unit tests
-
### Setup your environment for tests
-The framework used is [PHPUnit](https://phpunit.de/); it can be installed with [Composer](https://getcomposer.org/), which is a dependency management tool.[](.html)
+
+The framework used is [PHPUnit](https://phpunit.de/); it can be installed with [Composer](https://getcomposer.org/), which is a dependency management tool.
Regarding Composer, you can either use:
* a system-wide version, e.g. installed through your distro's package manager
-* a local version, downloadable [here](https://getcomposer.org/download/)[](.html)
+* a local version, downloadable [here](https://getcomposer.org/download/)
#### Sample usage
+
```bash
# system-wide version
$ composer install
```
#### Install Shaarli dev dependencies
+
```bash
$ cd /path/to/shaarli
$ composer update
```
#### Install and enable Xdebug to generate PHPUnit coverage reports
+
For Debian-based distros:
```bash
$ aptitude install php5-xdebug
```
#### Run unit tests
+
Successful test suite:
```bash
$ make test
```
#### Test results and coverage
+
By default, PHPUnit will run all suitable tests found under the `tests` directory.
Each test has 3 possible outcomes:
* to open it in a web browser: `firefox coverage/index.html &`
### Executing specific tests
-Add a [`@group`](https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.group) annotation in a test class or method comment:[](.html)
+
+Add a [`@group`](https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.group) annotation in a test class or method comment:
```php
/**
*/
class BookmarkImportTest extends PHPUnit_Framework_TestCase
{
- [...][](.html)
+ [...]
}
```