source: branches/version-2_12_2/test/README.txt @ 20116

Revision 20116, 2.7 KB checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
Line 
1                    PHPUnit を使用したテストケースについて
2                 ____________________________________________
3
4    EC-CUBE では, PHPUnit を使用して, テスト駆動開発が可能です.
5    このドキュメントは, PHPUnit の使用方法を説明します.
6
7
81. PHPUnit について
9-------------------
10
11    PHPUnit
12    http://www.phpunit.de/
13
14    日本語マニュアル
15    http://www.phpunit.de/manual/3.4/ja/index.html
16
17    PHPUnit3.4.x を使用してテストを行います.
18    残念ながら, このバージョンでは PHP4 はサポートされません.
19
202. 動作環境
21-----------
22
23    http://www.phpunit.de/wiki/Requirements
24
253. インストール
26---------------
27
28    http://www.phpunit.de/manual/3.4/ja/installation.html
29
30    マニュアルに沿ってインストールしたあと, require.php にて
31    PHPUnit/Framework.php のフルパスを指定します.
32    これは, EC-CUBE が独自に include_path を設定するため必要です.
33
344. 実行方法
35-----------
36
37    EC-CUBE のクラス名は, PHPUnit の規約に沿ってないため, 引数で
38    PHPファイルを指定する必要があります.
39
40   
41    すべてのテストを実行するとき
42
43      TestSuite クラスを実行します.
44          ------------------------------------------------------------
45      $ phpunit TestSuite TestSuite.php
46      PHPUnit 3.4.13 by Sebastian Bergmann.
47
48      .................
49
50      Time: 0 seconds
51
52      OK (17 tests, 20 assertions)
53          ------------------------------------------------------------
54
55    パッケージごとにテストを実行するとき
56
57      Package_AllTests クラスを実行します.
58          ------------------------------------------------------------
59      $ phpunit DB_AllTests class/db/DB_AllTests.php
60      PHPUnit 3.4.13 by Sebastian Bergmann.
61
62      ....
63
64      Time: 0 seconds
65
66      OK (4 tests, 6 assertions)
67          ------------------------------------------------------------
68
69    クラスごとにテストを実行するとき
70
71      テストクラスを指定して実行します.
72          ------------------------------------------------------------
73      $ phpunit LC_Page_Test class/page/LC_Page_Test.php
74      PHPUnit 3.4.13 by Sebastian Bergmann.
75
76      ..........
77
78      Time: 0 seconds
79
80      OK (10 tests, 11 assertions)
81          ------------------------------------------------------------
82
83
84      カレントディレクトリからも実行可能です.
85          ------------------------------------------------------------
86          $ cd class/page
87      $ phpunit LC_Page_Test LC_Page_Test.php
88      PHPUnit 3.4.13 by Sebastian Bergmann.
89
90      ..........
91
92      Time: 0 seconds
93
94      OK (10 tests, 11 assertions)
95          ------------------------------------------------------------
96
Note: See TracBrowser for help on using the repository browser.