Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit cb91a84

Browse files
tarohidakuromoka
authored andcommitted
1 parent 6706044 commit cb91a84

File tree

1 file changed

+39
-55
lines changed

1 file changed

+39
-55
lines changed

src/textui.rst

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
のコマンドライン版テストランナーが起動します。
1111
コマンドラインのテストランナーを使用したテストの様子を以下に示します。
1212

13-
.. code-block:: bash
13+
.. parsed-literal::
1414
1515
$ phpunit ArrayTest
1616
PHPUnit |version|.0 by Sebastian Bergmann and contributors.
@@ -74,66 +74,64 @@ PHPUnit は、*失敗 (failures)* と
7474

7575
以下のコードで、コマンドライン版テストランナーのオプションの一覧を見てみましょう。
7676

77-
.. code-block:: bash
77+
.. parsed-literal::
7878
7979
$ phpunit --help
8080
PHPUnit |version|.0 by Sebastian Bergmann and contributors.
8181
82-
Usage: phpunit [options] UnitTest [UnitTest.php]
83-
phpunit [options] <directory>
82+
Usage:
83+
phpunit [options] UnitTest.php
84+
phpunit [options] <directory>
8485
8586
Code Coverage Options:
86-
8787
--coverage-clover <file> Generate code coverage report in Clover XML format
8888
--coverage-crap4j <file> Generate code coverage report in Crap4J XML format
8989
--coverage-html <dir> Generate code coverage report in HTML format
9090
--coverage-php <file> Export PHP_CodeCoverage object to file
91-
--coverage-text=<file> Generate code coverage report in text format
92-
Default: Standard output
91+
--coverage-text=<file> Generate code coverage report in text format [default: standard output]
9392
--coverage-xml <dir> Generate code coverage report in PHPUnit XML format
94-
--whitelist <dir> Whitelist <dir> for code coverage analysis
93+
--coverage-cache <dir> Cache static analysis results
94+
--warm-coverage-cache Warm static analysis cache
95+
--coverage-filter <dir> Include <dir> in code coverage analysis
96+
--path-coverage Perform path coverage analysis
9597
--disable-coverage-ignore Disable annotations for ignoring code coverage
9698
--no-coverage Ignore code coverage configuration
97-
--dump-xdebug-filter <file> Generate script to set Xdebug code coverage filter
9899
99100
Logging Options:
100-
101101
--log-junit <file> Log test execution in JUnit XML format to file
102102
--log-teamcity <file> Log test execution in TeamCity format to file
103103
--testdox-html <file> Write agile documentation in HTML format to file
104104
--testdox-text <file> Write agile documentation in Text format to file
105105
--testdox-xml <file> Write agile documentation in XML format to file
106106
--reverse-list Print defects in reverse order
107+
--no-logging Ignore logging configuration
107108
108109
Test Selection Options:
109-
110110
--filter <pattern> Filter which tests to run
111-
--testsuite <name,...> Filter which testsuite to run
112-
--group ... Only runs tests from the specified group(s)
113-
--exclude-group ... Exclude tests from the specified group(s)
111+
--testsuite <name> Filter which testsuite to run
112+
--group <name> Only runs tests from the specified group(s)
113+
--exclude-group <name> Exclude tests from the specified group(s)
114114
--list-groups List available test groups
115115
--list-suites List available test suites
116116
--list-tests List available tests
117117
--list-tests-xml <file> List available tests in XML format
118-
--test-suffix ... Only search for test in files with specified
119-
suffix(es). Default: Test.php,.phpt
118+
--test-suffix <suffixes> Only search for test in files with specified suffix(es). Default: Test.php,.phpt
120119
121120
Test Execution Options:
122-
123121
--dont-report-useless-tests Do not report tests that do not test anything
124122
--strict-coverage Be strict about @covers annotation usage
125123
--strict-global-state Be strict about changes to global state
126124
--disallow-test-output Be strict about output during tests
127125
--disallow-resource-usage Be strict about resource usage during small tests
128126
--enforce-time-limit Enforce time limit based on test size
129-
--default-time-limit=<sec> Timeout in seconds for tests without @small, @medium or @large
127+
--default-time-limit <sec> Timeout in seconds for tests without @small, @medium or @large
130128
--disallow-todo-tests Disallow @todo-annotated tests
131129
132130
--process-isolation Run each test in a separate PHP process
133131
--globals-backup Backup and restore $GLOBALS for each test
134132
--static-backup Backup and restore static attributes for each test
135133
136-
--colors=<flag> Use colors in output ("never", "auto" or "always")
134+
--colors <flag> Use colors in output ("never", "auto" or "always")
137135
--columns <n> Number of columns to use for progress output
138136
--columns max Use maximum number of columns for progress output
139137
--stderr Write to STDERR instead of STDOUT
@@ -144,39 +142,40 @@ PHPUnit は、*失敗 (failures)* と
144142
--stop-on-risky Stop execution upon first risky test
145143
--stop-on-skipped Stop execution upon first skipped test
146144
--stop-on-incomplete Stop execution upon first incomplete test
147-
--fail-on-warning Treat tests with warnings as failures
145+
--fail-on-incomplete Treat incomplete tests as failures
148146
--fail-on-risky Treat risky tests as failures
147+
--fail-on-skipped Treat skipped tests as failures
148+
--fail-on-warning Treat tests with warnings as failures
149149
-v|--verbose Output more verbose information
150150
--debug Display debugging information
151151
152-
--loader <loader> TestSuiteLoader implementation to use
153152
--repeat <times> Runs the test(s) repeatedly
154153
--teamcity Report test execution progress in TeamCity format
155154
--testdox Report test execution progress in TestDox format
156155
--testdox-group Only include tests from the specified group(s)
157156
--testdox-exclude-group Exclude tests from the specified group(s)
157+
--no-interaction Disable TestDox progress animation
158158
--printer <printer> TestListener implementation to use
159159
160-
--resolve-dependencies Resolve dependencies between tests
161-
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
162-
--random-order-seed=<N> Use a specific random seed <N> for random order
163-
--cache-result Write run result to cache to enable ordering tests defects-first
160+
--order-by <order> Run tests in order: default|defects|duration|no-depends|random|reverse|size
161+
--random-order-seed <N> Use a specific random seed <N> for random order
162+
--cache-result Write test results to cache file
163+
--do-not-cache-result Do not write test results to cache file
164164
165165
Configuration Options:
166-
167166
--prepend <file> A PHP script that is included as early as possible
168167
--bootstrap <file> A PHP script that is included before the tests run
169168
-c|--configuration <file> Read configuration from XML file
170169
--no-configuration Ignore default configuration file (phpunit.xml)
171-
--no-logging Ignore logging configuration
170+
--extensions <extensions> A comma separated list of PHPUnit extensions to load
172171
--no-extensions Do not load PHPUnit extensions
173172
--include-path <path(s)> Prepend PHP's include_path with given path(s)
174-
-d key[=value] Sets a php.ini value
173+
-d <key[=value]> Sets a php.ini value
174+
--cache-result-file <file> Specify result cache path and filename
175175
--generate-configuration Generate configuration file with suggested settings
176-
--cache-result-file==<FILE> Specify result cache path and filename
176+
--migrate-configuration Migrate configuration file to current format
177177
178178
Miscellaneous Options:
179-
180179
-h|--help Prints this usage information
181180
--version Prints the version and exits
182181
--atleast-version <min> Checks that version is greater than min and exits
@@ -202,49 +201,32 @@ PHPUnit は、*失敗 (failures)* と
202201
``--coverage-clover``
203202

204203
テスト結果から XML 形式のログファイルを作成し、
205-
コードカバレッジ情報もそこに含めます。
206-
詳細は :ref:`logging` を参照ください。
207-
208-
この機能は、tokenizer 拡張モジュールおよび Xdebug
209-
拡張モジュールがインストールされている場合にのみ使用可能となることに注意しましょう。
204+
コードカバレッジ情報もそこに含めます。詳細は
205+
:ref:`code-coverage-analysis` を参照ください。
210206

211207
``--coverage-crap4j``
212208

213209
コードカバレッジレポートを Crap4j 形式で作成します。詳細は
214210
:ref:`code-coverage-analysis` を参照ください。
215211

216-
この機能は、tokenizer 拡張モジュールおよび Xdebug
217-
拡張モジュールがインストールされている場合にのみ使用可能となることに注意しましょう。
218-
219212
``--coverage-html``
220213

221214
コードカバレッジレポートを HTML 形式で作成します。詳細は
222215
:ref:`code-coverage-analysis` を参照ください。
223216

224-
この機能は、tokenizer 拡張モジュールおよび Xdebug
225-
拡張モジュールがインストールされている場合にのみ使用可能となることに注意しましょう。
226-
227217
``--coverage-php``
228218

229219
シリアライズした PHP_CodeCoverage オブジェクトを生成し、
230220
コードカバレッジ情報もそこに含めます。
231221

232-
この機能は、tokenizer 拡張モジュールおよび Xdebug
233-
拡張モジュールがインストールされている場合にのみ使用可能となることに注意しましょう。
234-
235222
``--coverage-text``
236223

237224
テストを実行したときに、ログファイルあるいはコマンドライン出力で
238225
可読形式のコードカバレッジ情報を生成します。
239-
詳細は :ref:`logging` を参照ください。
240-
241-
この機能は、tokenizer 拡張モジュールおよび Xdebug
242-
拡張モジュールがインストールされている場合にのみ使用可能となることに注意しましょう。
243226

244227
``--log-junit``
245228

246229
JUnit XML フォーマットを使用して、テストの実行結果のログを作成します。
247-
詳細は :ref:`logging` を参照ください。
248230

249231
``--testdox-html`` および ``--testdox-text``
250232

@@ -281,10 +263,10 @@ PHPUnit は、*失敗 (failures)* と
281263
:name: textui.examples.TestCaseClass.php
282264
283265
<?php
284-
use PHPUnit\Framework\TestCase;
285-
286266
namespace TestNamespace;
287267
268+
use PHPUnit\Framework\TestCase;
269+
288270
class TestCaseClass extends TestCase
289271
{
290272
/**
@@ -508,7 +490,7 @@ PHPUnit は、*失敗 (failures)* と
508490
:file:`phpunit.xml` あるいは
509491
:file:`phpunit.xml.dist` (この順番で使用します)
510492
が現在の作業ディレクトリに存在しており、かつ ``--configuration``
511-
が使われて*いない*場合、設定が自動的にそのファイルから読み込まれます。
493+
が使われて *いない* 場合、設定が自動的にそのファイルから読み込まれます。
512494

513495
指定されているのがディレクトリで、
514496
:file:`phpunit.xml` あるいは
@@ -530,7 +512,9 @@ PHPUnit は、*失敗 (failures)* と
530512

531513
.. admonition:: Note
532514

533-
PHPUnit 4.8 以降では、これらのオプションを引数の後にも指定できるようになりました。
515+
これらのオプションは、引数の後に指定することもできます。
516+
517+
.. _textui.testdox:
534518

535519
TestDox
536520
#######
@@ -546,9 +530,9 @@ PHPUnit の TestDox 機能は、テストクラス内のすべてのテストメ
546530

547531
``BankAccount`` クラスのアジャイルな文書を見てみましょう。
548532

549-
.. code-block:: bash
533+
.. parsed-literal::
550534
551-
$ phpunit --testdox BankAccountTest
535+
$ phpunit --testdox BankAccountTest.php
552536
PHPUnit |version|.0 by Sebastian Bergmann and contributors.
553537
554538
BankAccount

0 commit comments

Comments
 (0)