10000 minor #6092 Updated information about testing code coverage. (roga) · symfony/symfony-docs@77d92e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77d92e7

Browse files
committed
minor #6092 Updated information about testing code coverage. (roga)
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.
2 parents d3744cb + 8a5a239 commit 77d92e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

create_framework/unit_testing.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ using `PHPUnit`_. Create a PHPUnit configuration file in
2626
<directory>./tests</directory>
2727
</testsuite>
2828
</testsuites>
29+
<filter>
30+
<whitelist processUncoveredFilesFromWhitelist="true">
31+
<directory suffix=".php">./src</directory>
32+
</whitelist>
33+
</filter>
2934
</phpunit>
3035
3136
This configuration defines sensible defaults for most PHPUnit settings; more
@@ -180,6 +185,12 @@ Open ``example.com/cov/src/Simplex/Framework.php.html`` in a browser and check
180185
that all the lines for the Framework class are green (it means that they have
181186
been visited when the tests were executed).
182187

188+
Alternatively you can output the result directly to the console:
189+
190+
.. code-block:: bash
191+
192+
$ phpunit --coverage-text
193+
183194
Thanks to the simple object-oriented code that we have written so far, we have
184195
been able to write unit-tests to cover all possible use cases of our
185196
framework; test doubles ensured that we were actually testing our code and not

0 commit comments

Comments
 (0)
0