Skip to content

Commit

Permalink
minor #6092 Updated information about testing code coverage. (roga)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Updated information about testing code coverage.

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | -

This is just a rebase of #5929 to make it mergeable.

Commits
-------

8a5a239 Updated information about testing code coverage.
  • Loading branch information
wouterj committed Feb 6, 2016
2 parents d3744cb + 8a5a239 commit 77d92e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions create_framework/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ using `PHPUnit`_. Create a PHPUnit configuration file in
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
This configuration defines sensible defaults for most PHPUnit settings; more
Expand Down Expand Up @@ -180,6 +185,12 @@ Open ``example.com/cov/src/Simplex/Framework.php.html`` in a browser and check
that all the lines for the Framework class are green (it means that they have
been visited when the tests were executed).

Alternatively you can output the result directly to the console:

.. code-block:: bash
$ phpunit --coverage-text
Thanks to the simple object-oriented code that we have written so far, we have
been able to write unit-tests to cover all possible use cases of our
framework; test doubles ensured that we were actually testing our code and not
Expand Down

0 comments on commit 77d92e7

Please sign in to comment.