X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2Fmd%2FUnit-tests.md;h=f6030d5c2f6134848b58ed8987f1458c8dd4df23;hb=76c3a4dbed11b9a5df2437db00e96608244bd693;hp=1983872193bfd861129de6698cefa6eef05087b0;hpb=5b25a9635fe808bc1c4f3eee8cdf8485115da75d;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/md/Unit-tests.md b/doc/md/Unit-tests.md index 19838721..f6030d5c 100644 --- a/doc/md/Unit-tests.md +++ b/doc/md/Unit-tests.md @@ -2,11 +2,12 @@ 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/) +### Install composer -#### Sample usage +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/). ```bash # system-wide version @@ -28,6 +29,8 @@ $ composer update #### Install and enable Xdebug to generate PHPUnit coverage reports +See http://xdebug.org/docs/install + For Debian-based distros: ```bash $ aptitude install php5-xdebug @@ -118,18 +121,20 @@ Tests: 36, Assertions: 63, Errors: 1, Failures: 2. By default, PHPUnit will run all suitable tests found under the `tests` directory. Each test has 3 possible outcomes: -* `.` - success -* `F` - failure: the test was run but its results are invalid - * the code does not behave as expected - * dependencies to external elements: globals, session, cache... -* `E` - error: something went wrong and the tested code has crashed - * typos in the code, or in the test code - * dependencies to missing external elements + +- `.` - success +- `F` - failure: the test was run but its results are invalid + - the code does not behave as expected + - dependencies to external elements: globals, session, cache... +- `E` - error: something went wrong and the tested code has crashed + - typos in the code, or in the test code + - dependencies to missing external elements If Xdebug has been installed and activated, two coverage reports will be generated: -* a summary in the console -* a detailed HTML report with metrics for tested code - * to open it in a web browser: `firefox coverage/index.html &` + +- a summary in the console +- a detailed HTML report with metrics for tested code + - to open it in a web browser: `firefox coverage/index.html &` ### Executing specific tests