Installing PHPUnit

个人技术博客:[url]http://www.cooli.cc/[/url]

PHPUnit should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.

Note
PHPUnit 3.4 requires PHP 5.1.4 (or later) but PHP 5.3.3 (or later) is highly recommended.

Xdebug 2.0.5 (or later) is required to collect and process code coverage information but Xdebug 2.1.0 (or later) is highly recommended.

The PEAR channel ([url]pear.phpunit.de[/url]) that is used to distribute PHPUnit needs to be registered with the local PEAR environment. Furthermore, a component that PHPUnit depends upon is hosted on the Symfony Components PEAR channel (pear.symfony-project.com).

pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com

This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:

pear install phpunit/PHPUnit

After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually /usr/lib/php/PHPUnit.

Although using the PEAR Installer is the only supported way to install PHPUnit, you can install PHPUnit manually. For manual installation, do the following:

Download a release archive from http://pear.phpunit.de/get/ and extract it to a directory that is listed in the include_path of your php.ini configuration file.

Prepare the phpunit script:

Rename the phpunit.php script to phpunit.

Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).

Copy it to a directory that is in your path and make it executable (chmod +x phpunit).

Prepare the PHPUnit/Util/PHP.php script:

Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值