微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PHP – 是否有PHPUnit的可移植版本?

是否有可以与我的Web应用程序捆绑的 PHPUnit的可移植版本?我希望能够在任何服务器上使用PHPunit,同时避免使用PEAR(版本冲突,破坏其他托管应用程序等)的问题.
便携式PHPunit(取自 https://github.com/sebastianbergmann/phpunit“使用来自Git Checkout的PHPUnit”)

对于PHPunit 3.5:

git clone git://github.com/sebastianbergmann/PHPunit.git
git clone git://github.com/sebastianbergmann/dbunit.git
git clone git://github.com/sebastianbergmann/PHP-file-iterator.git
git clone git://github.com/sebastianbergmann/PHP-text-template.git
git clone git://github.com/sebastianbergmann/PHP-code-coverage.git
git clone git://github.com/sebastianbergmann/PHP-token-stream.git
git clone git://github.com/sebastianbergmann/PHP-timer.git
git clone git://github.com/sebastianbergmann/PHPunit-mock-objects.git
git clone git://github.com/sebastianbergmann/PHPunit-selenium.git

cd PHPunit && git checkout 3.5 && cd ..
cd dbunit && git checkout 1.0 && cd ..
cd PHP-file-iterator && git checkout 1.2 && cd ..
cd PHP-code-coverage && git checkout 1.0 && cd ..
cd PHP-token-stream && git checkout 1.0 && cd ..
cd PHPunit-mock-objects && git checkout 1.0 && cd ..
cd PHPunit-selenium && git checkout 1.0 && cd ..

然后将每个文件夹放入包含路径中.

如果您遗漏任何一个包,它将无法工作.

如果你不想总是在include路径中有它们,那么这是一个PHPunit.sh可执行文件

PHPunit.sh

x='./checkoutDir/';

PHP -d include_path=".:$x/PHPunit/:$x/dbunit/:$x/PHP-code-coverage/:$x/PHP-file-iterator/:$x/PHP-text-template/:$x/PHP-timer/:$x/PHP-token-stream/:$x/PHPunit-mock-objects/:$x/PHPunit-selenium/:$x/PHPunit-story/:/usr/share/PHP/"  $x/PHPunit/PHPunit.PHP $*

原文地址:https://www.jb51.cc/php/137925.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐