如何在phpunit中运行目录结构测试?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了如何在phpunit中运行目录结构测试?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2160字,纯文字阅读大概需要4分钟。
内容图文
![如何在phpunit中运行目录结构测试?](/upload/InfoBanner/zyjiaocheng/673/63b76de6adc24c0baa58224bd01f186c.jpg)
PHPUnit文档说,我可以将所有测试放到一个文件夹中,然后在该文件夹上运行phpunit,一次执行所有测试:
http://www.phpunit.de/manual/current/en/organizing-tests.html
但是,当我尝试使用Slim(https://github.com/codeguy/Slim)的分支副本时,它不起作用!我已经通过PEAR安装了PHPUnit,所以我认为这没有什么奇怪的.
这是输出:
mark@ubuntu:/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
有什么想法我做错了吗?
-编辑-
我正在使用PHPUnit 3.5.15.
这是目录Slim和测试的内容:
mark@ubuntu:/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
mark@ubuntu:/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分叉并克隆了它,没什么好看的!
解决方法:
通常,您在包含phpunit.xml和/或bootstrap.php的任何文件夹中发出phpunit命令.我的猜测是它们位于tests文件夹内.
.../Slim$cd tests
.../Slim/tests$phpunit
内容总结
以上是互联网集市为您收集整理的如何在phpunit中运行目录结构测试?全部内容,希望文章能够帮你解决如何在phpunit中运行目录结构测试?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。