PHP-是否有可移植的PHPUnit版本? [英] PHP - Is there a portable version of PHPUnit?

查看:71
本文介绍了PHP-是否有可移植的PHPUnit版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在可与网络应用程序捆绑在一起的可移植版本的PHPUnit?我希望能够在任何服务器上使用phpunit,同时避免使用PEAR的问题(版本冲突,破坏其他托管应用程序等).

Is there a portable version of PHPUnit that I can bundle with my web app? I want to be able to use phpunit on any server while avoiding the issues of using PEAR (version conflicts, breaking other hosted apps, etc.).

推荐答案

便携式phpunit(摘自 https://github .com/sebastianbergmann/phpunit 从Git Checkout使用PHPUnit")

Portable phpunit (taken from https://github.com/sebastianbergmann/phpunit "Using PHPUnit From a Git Checkout" )

对于phpunit 3.5:

For 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 ..

,然后将其中的每个文件夹都放入您的包含路径.

and then put every single of those folders into your include path.

如果您遗漏了其中任何一个程序包,它将无法正常工作.

It will not work if you leave out any one of those packages.

如果您不希望它们始终包含在包含路径中,那么这里是一个phpunit.sh可执行文件

If you don't want to always have them in the include path here is a phpunit.sh executable

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 $*

这篇关于PHP-是否有可移植的PHPUnit版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆