Skip to content

Commit 502b621

Browse files
author
Brice Favre
committed
WIP Translation codecoverage-analysis:40,test-doubles.xml:149
1 parent 242dc79 commit 502b621

File tree

4 files changed

+50
-20
lines changed

4 files changed

+50
-20
lines changed

src/6.1/fr/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Attention, la documentation est en cours de traduction (cf. tableau ci dessous)
2121
* Mettre à jour les fichiers existants
2222
* Partir à la chasse aux typos et aux fautes d'orthographes, de grammaire et de syntaxes
2323
* Détecter le franglais et les anglicismes
24+
* Revue de pair sur les PR
2425

2526

2627
## Plan
@@ -31,7 +32,7 @@ Attention, la documentation est en cours de traduction (cf. tableau ci dessous)
3132
| assertions.xml | NOK | |
3233
| bibliography.xml | NOK | |
3334
| book.xml | NOK | |
34-
| code-coverage-analysis.xml | NOK | |
35+
| code-coverage-analysis.xml | En cours | @brice |
3536
| configuration.xml | NOK | |
3637
| copyright.xml | NOK | |
3738
| database.xml | NOK | |

src/6.1/fr/code-coverage-analysis.xml

+25-9
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,41 @@
44
<title>Analyse de couverture de code</title>
55

66
<blockquote>
7-
<attribution>Murali Nandigama</attribution>
7+
<attribution>Wikipedia</attribution>
88
<para>
9-
La beauté du test ne se trouve pas dans l'effort mais dans l'efficience.
10-
</para>
11-
<para>
12-
Savoir ce qui doit être testé est magnifique, et savoir ce qui est testé
13-
est magnifique.
9+
La couverture de code (en anglais : code coverage) est une mesure utilisée
10+
en génie logiciel pour décrire le taux de code source testé d'un programme.
11+
Ceci permet de mesurer la qualité des tests effectués.
12+
13+
In computer science, code coverage is a measure used to describe the
14+
degree to which the source code of a program is tested by a particular
15+
test suite. A program with high code coverage has been more thoroughly
16+
tested and has a lower chance of containing software bugs than a program
17+
with low code coverage.
1418
</para>
1519
</blockquote>
16-
1720
<para>
1821
<indexterm><primary>Couverture de code</primary></indexterm>
22+
<indexterm><primary>Xdebug</primary></indexterm>
1923

2024
Dans ce chapitre, vous apprendrez tout sur la fonctionnalité de couverture
2125
de code de PHPUnit qui fournit une vision interne des parties du code de
22-
production qui sont exécutées quand les tests sont exécutés. Cela aide à
23-
répondre à des questions comme :
26+
production qui sont exécutées quand les tests sont exécutés. Elle utilise le composant
27+
<ulink url="https://github.com/sebastianbergmann/php-code-coverage">PHP_CodeCoverage</ulink>
28+
qui tire parti de la fonctionnalité de couverture de code fournie par l'extension
29+
<ulink url="http://xdebug.org/">Xdebug</ulink> de PHP.
2430
</para>
2531

32+
<note>
33+
<para>
34+
Xdebug n'est pas distribué au sein de PHPUnit. Si une notice indiquant que
35+
l'extension Xdebug n'est pas chargé en lançant les tests, cela signifie que
36+
Xdebug n'est pas installé ou n'est pas configuré correctement. Avant de pouvoir
37+
utiliser les fonctionnalités de couverture de code dans PHPUnit, vous devez lire
38+
<ulink url="http://xdebug.org/docs/install">le guide d'installation de Xdebug.</ulink>.
39+
</para>
40+
</note>
41+
2642
<itemizedlist>
2743
<listitem>
2844
<para>

src/6.1/fr/installation.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,30 @@
5858
<literal>php.ini</literal>:
5959

6060
<screen>
61-
suhosin.executor.include.whitelist = phar
62-
</screen>
61+
suhosin.executor.include.whitelist = phar
62+
</screen>
6363
</para>
6464

6565
<para>
6666
To globally install the PHAR:
6767
</para>
6868

6969
<screen>
70-
<prompt>$</prompt> <userinput>wget https://phar.phpunit.de/phpunit-6.1.phar</userinput>
71-
<prompt>$</prompt> <userinput>chmod +x phpunit-6.1.phar</userinput>
72-
<prompt>$</prompt> <userinput>sudo mv phpunit-6.1.phar /usr/local/bin/phpunit</userinput>
73-
<prompt>$</prompt> <userinput>phpunit --version</userinput>
74-
<computeroutput>PHPUnit x.y.z by Sebastian Bergmann and contributors.</computeroutput>
70+
<prompt>$</prompt> <userinput>wget https://phar.phpunit.de/phpunit-6.1.phar</userinput>
71+
<prompt>$</prompt> <userinput>chmod +x phpunit-6.1.phar</userinput>
72+
<prompt>$</prompt> <userinput>sudo mv phpunit-6.1.phar /usr/local/bin/phpunit</userinput>
73+
<prompt>$</prompt> <userinput>phpunit --version</userinput>
74+
<computeroutput>PHPUnit x.y.z by Sebastian Bergmann and contributors.</computeroutput>
7575
</screen>
7676

7777
<para>
7878
You may also use the downloaded PHAR file directly:
7979
</para>
8080

8181
<screen>
82-
<prompt>$</prompt> <userinput>wget https://phar.phpunit.de/phpunit-6.1.phar</userinput>
83-
<prompt>$</prompt> <userinput>php phpunit-6.1.phar --version</userinput>
84-
<computeroutput>PHPUnit x.y.z by Sebastian Bergmann and contributors.</computeroutput>
82+
<prompt>$</prompt> <userinput>wget https://phar.phpunit.de/phpunit-6.1.phar</userinput>
83+
<prompt>$</prompt> <userinput>php phpunit-6.1.phar --version</userinput>
84+
<computeroutput>PHPUnit x.y.z by Sebastian Bergmann and contributors.</computeroutput>
8585
</screen>
8686

8787
<section id="installation.phar.windows">

src/6.1/fr/test-doubles.xml

+13
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ class StubTest extends TestCase
145145
?>]]></programlisting>
146146
</example>
147147

148+
<note>
149+
<title>Limitation: Méthodes nommées "method"</title>
150+
151+
<para>
152+
The example shown above only works when the original class does not
153+
declare a method named "method".
154+
</para>
155+
156+
<para>
157+
If the original class does declare a method named "method" then <literal><![CDATA[$stub->expects($this->any())->method('doSomething')->willReturn('foo');]]></literal> has to be used.
158+
</para>
159+
</note>
160+
148161
<para>
149162
"Derrière la scène", PHPUnit génère automatiquement une nouvelle classe qui
150163
implémente le comportement souhaité quand la méthode <literal>getMock()</literal>

0 commit comments

Comments
 (0)