forked from fuel/docs
-
Notifications
You must be signed in to change notification settings - Fork 119
/
test.html
130 lines (122 loc) · 7.51 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./../../assets/css/combined.css">
<link rel="shortcut icon" href="./../../favicon.ico" />
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
var path = './../../';
</script>
<script src="./../../assets/js/combined.js"></script>
<title>テスト - Oil パッケージ - FuelPHP ドキュメント</title>
</head>
<body>
<div id="container">
<header id="header">
<div class="table">
<h1>
<a href="http://fuelphp.com"><img height="37px" width="147px" src="./../../assets/img/fuel.png" /></a>
<strong>Documentation</strong>
</h1>
<form id="google_search">
<p>
<span id="search_clear"> </span>
<input type="submit" name="search_submit" id="search_submit" value="検索" />
<input type="text" value="" id="search_input" name="search_input" />
</p>
</form>
</div>
<nav>
<div class="clear"></div>
</nav>
<a href="#" id="toc_handle">目次</a>
<div class="clear"></div>
</header>
<div id="cse">
<div id="cse_point"></div>
<div id="cse_content"></div>
</div>
<div id="main">
<section>
<h2 id="test">テスト</h2>
<p><code>oil test</code> (or <code>oil t</code>) コマンドは Web アプリ、モジュール、パッケージに関連した PHPUnit のテストを実行します。FuelPHP でのユニットテストに関する完全なドキュメントは <a href="../../general/unit_testing.html">ユニットテスト</a> のドキュメントページにあり、PHPUnit に関する完全なドキュメントは <a href="http://www.phpunit.de/manual/current/ja/index.html">PHPUnit の Web サイト</a> にあります。</p>
<h3 id="configuration">設定</h3>
<p>oil ユーティリティはそれ自身はさほど多くの設定を必要としません。しかし PHPUnit がシステムグローバルな環境にインストールされていない場合 (例えば、PHPUnit を Composer を使ってプロジェクト内にインストールしている場合)、oil に対して PHPUnit がインストールされている場所を知らせないといけません。<code>app/config/oil.php</code>設定ファイルを新規に作成 (または oil パッケージの中からコピー) して、必要ならば以下の設定を変更します:</p>
<h4 id="phpunit_configuration">PHPUnit の設定</h4>
<table class="config">
<tr class="header">
<th>項目</th>
<th>型</th>
<th>デフォルト</th>
<th>説明</th>
</tr>
<tr>
<th>phpunit.autoload_path</th>
<td>string</td>
<td><pre class="php"><code class="php">'PHPUnit/Autoload.php'</code></pre></td>
<td>PHPUnit の Autoload ファイルの場所。</td>
</tr>
<tr>
<th>phpunit.binary_path</th>
<td>string</td>
<td><pre class="php"><code class="php">'phpunit'</code></pre></td>
<td>phpunit を実行するコマンド (必要ならばフルパスで)。</td>
</tr>
</table>
<h4 id="cli_options">コマンドラインオプション</h4>
<p>Test は PHPUnit のいくつかのコマンドラインオプションをサポートします :</p>
<p><code>--file=<file></code> 特定のファイルのテストのみを実行します。</p>
<p><code>--group=<group></code> 特定の (複数) グループのテストのみを実行します。</p>
<p><code>--testsuite=<testsuite></code> 特定の (複数の) テストスィートのみを実行します。</p>
<p><code>--exclude-group=<group></code> 特定の (複数) グループのテストを除外します。</p>
<p><code>--coverage-clover=<file></code> コードカバレッジレポートを Clover の XML 形式で生成します。</p>
<p><code>--coverage-html=<dir></code> コードカバレッジレポートを HTML 形式で生成します。</p>
<p><code>--coverage-php=<file></code> PHP_CodeCoverage オブジェクトをシリアライズしてファイルにします。</p>
<p><code>--coverage-text=<file></code> コードカバレッジレポートを テキスト形式で生成します。</p>
<p><code>--log-junit=<file></code> テスト実行のレポートを Junit XML 形式で生成します。</p>
<p><code>--debug</code> テスト実行中にデバッグ情報を表示します。</p>
<p>これらのコマンドとその動作に関する情報については <a
href="http://www.phpunit.de/manual/current/en/textui.html#textui.clioptions">PHPUnit Documentation</a>を参照してください。</p>
<h4 id="phpunit_config">PHPUnit テストランナーの設定</h4>
<p>Oil は <code>COREPATH</code> ディレクトリにある <code>phpunit.xml</code> というテストランナーの設定をデフォルトで PHPUnit に渡します。</p>
<p><code>fuel/core/phpunit.xml</code> にある Fuel の基本的な phpunit.xml は以下を含みます :</p>
<pre class='xml'><code><?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" stopOnFailure="false" bootstrap="../core/bootstrap_phpunit.php">
<php>
<server name="doc_root" value="../../"/>
<server name="app_path" value="fuel/app"/>
<server name="core_path" value="fuel/core"/>
<server name="package_path" value="fuel/packages"/>
</php>
<testsuites>
<testsuite name="core">
<directory suffix=".php">../core/tests</directory>
</testsuite>
<testsuite name="packages">
<directory suffix=".php">../packages/*/tests</directory>
</testsuite>
<testsuite name="app">
<directory suffix=".php">../app/tests</directory>
</testsuite>
</testsuites>
</phpunit>
</code></pre>
<p>もしこの設定ファイルを変更する必要があるなら、<code>APPPATH</code> にコピーして、そのコピーしたものを編集して下さい。Oil はデフォルトの代わりに新しい設定ファイルを認識し、あなたのカスタム設定を使用します。</p>
<p>例えばモジュールを開発しているならば、当然そのための以下の様なテストスイートを設定に追加したいと思うでしょう:</p>
<pre class='xml'><code> <testsuite name="modules">
<directory suffix=".php">../modules/*/tests</directory>
</testsuite>
</code></pre>
</section>
</div>
<footer>
<p>
© FuelPHP Development Team 2010-2016 - <a href="http://fuelphp.com">FuelPHP</a> is released under the MIT license.
[ <a href="https://github.com/fuel/docs/commits/1.8/develop/packages/oil/test.html">原文コミット履歴</a> | <a href="https://github.com/NEKOGET/FuelPHP_docs_jp/commits/1.8/develop_japanese/packages/oil/test.html">翻訳コミット履歴</a> | <a href="https://github.com/NEKOGET/FuelPHP_docs_jp/blob/1.8/develop_japanese/packages/oil/test.html">GitHubで修正</a> ]
</p>
</footer>
</div>
</body>
</html>