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。我将编辑问题以包含文件夹的内容。谢谢! –