PHPUnit的文檔說我推了所有的考試到一個文件夾,該文件夾上運行phpunit
執行他們都一氣呵成:如何在phpunit中運行目錄結構化測試?
http://www.phpunit.de/manual/current/en/organizing-tests.html
但是當我嘗試在我的分叉修身的副本( https://github.com/codeguy/Slim)它不起作用!我已經通過PEAR安裝了PHPUnit,所以我不認爲這有什麼奇怪的。
下面是輸出:
[email protected]:/project/submodules/Slim$ phpunit tests
PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Neither "tests.php" nor "tests.php" could be opened.' in /usr/share/php/PHPUnit/Util/Skeleton/Test.php:102
Stack trace:
#0 /usr/share/php/PHPUnit/TextUI/Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('tests', '')
#1 /usr/share/php/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#2 /usr/bin/phpunit(49): PHPUnit_TextUI_Command::main()
#3 {main}
thrown in /usr/share/php/PHPUnit/Util/Skeleton/Test.php on line 102
任何想法我做錯了嗎?
-EDIT-
我正在使用PHPUnit 3.5.15。
這裏是目錄Slim
和tests
的內容:
[email protected]:/project/submodules/Slim$ ls -l
total 20
-rw-r--r-- 1 mark mark 4320 Aug 23 14:41 README.markdown
drwxr-xr-x 1 mark mark 408 Aug 24 02:39 Slim
-rw-r--r-- 1 mark mark 6993 Aug 23 14:41 index.php
-rw-r--r-- 1 mark mark 1398 Aug 23 14:41 logo.png
drwxr-xr-x 1 mark mark 476 Aug 23 14:41 tests
[email protected]:/project/submodules/Slim$ ls -l tests
total 104
-rw-r--r-- 1 mark mark 73 Aug 23 14:41 Foo.php
drwxr-xr-x 1 mark mark 204 Aug 23 14:41 Http
-rw-r--r-- 1 mark mark 4398 Aug 23 14:41 LogTest.php
-rw-r--r-- 1 mark mark 5088 Aug 23 14:41 LoggerTest.php
-rw-r--r-- 1 mark mark 734 Aug 23 14:41 README
-rw-r--r-- 1 mark mark 11115 Aug 23 14:41 RouteTest.php
-rw-r--r-- 1 mark mark 10327 Aug 23 14:41 RouterTest.php
drwxr-xr-x 1 mark mark 102 Aug 23 14:41 Session
-rw-r--r-- 1 mark mark 47703 Aug 23 14:41 SlimTest.php
-rw-r--r-- 1 mark mark 6447 Aug 23 14:41 ViewTest.php
drwxr-xr-x 1 mark mark 102 Aug 23 14:41 logs
drwxr-xr-x 1 mark mark 102 Aug 23 14:41 templates
我真的只是分叉苗條和克隆它,沒有什麼花哨!
你可以粘貼'Slim'和'tests'文件夾的內容嗎? –
適合我。什麼是PHPUnit版本? – netcoder
它是PHPUnit v3.5.15。我將編輯問題以包含文件夾的內容。謝謝! –