PHPUnit袖珍指南-第四章 安装PHPUnit
来源:互联网 发布:c 高级编程第三版 编辑:程序博客网 时间:2024/05/16 23:51
第4章 安装PHPUnit
PHPUnit可以通过PHP扩展和程序库(PEAE)获得。PEAR是可重用PHP组件的框架和分发系统。安装PHPUnit可以通过PEAR安装程序命令获得:
pear install PHPUnit2
根据PEAR的版本命名标准,适用于PHP5的PHPUnit包称为PHPUnit2。PHPUnit是适用于PHP4的包,这在本书后面关于“在PHP4中使用PHPUnit”一章会提到。
安装只有,能够在本地的PEAR目录中找到PHPUnit的源代码,路径通常是/usr/lib/ php/PHPUnit2。
尽管使用PEAR安装程序是PHPUnit唯一支持的安装方法,但你还是可以手工安装。要手工安装,参照以下做法:
1. 从http://pear.php.net/package/PHPUnit2/download下载PHPUnit发布包,然后解压缩,确保目录在php.ini定义的include_path中。
2. 准备phpunit脚本
a. 将pear-phpunit脚本改名为phpunit
b. 将脚本中所有的@php_bin@改名为PHP命令行解释器所在的目录(通常为/usr/bin/ php)。
c. 将此脚本拷贝到一个PATH环境变量所包含的目录中,并将文件属性改为可执行(chmod +x phpunit)。
3. 将PHPUnit2/ Runner/Version.php脚本中的所有@package_version@字符串替换为你所安装的PHPUnit版本(如2.3.0)。
--------------------------------------------------------------------------------------------------------------------
原文
Chapter 4. Installing PHPUnit
PHPUnit[1] is available from the PHP Extension and Application Repository (PEAR), [2] which is a framework and distribution system for reusable PHP components. It can be installed using the PEAR Installer:
[1] http://www.phpunit.de/
[2] http://pear.php.net/
$ pear install PHPUnit2
Due to PEAR's version-naming standard, the PHPUnit package for PHP 5 is called PHPUnit2. PHPUnit is the name of the PHPUnit package for PHP 4 that is the topic of "PHPUnit for PHP 4," later in this book.
After the installation, you can find the PHPUnit source files inside your local PEAR directory; the path is usually /usr/lib/ php/PHPUnit2.
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.php.net/package/PHPUnit2/download 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 pear-phpunit 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).
Replace the @package_version@ string in the PHPUnit2/ Runner/Version.php script with the version number of the PHPUnit release you are installing (2.3.0, for instance).
- PHPUnit袖珍指南-第四章 安装PHPUnit
- PHPUnit袖珍指南-第四章 安装PHPUnit
- PHPUnit袖珍指南-概述
- PHPUnit袖珍指南-概述
- PHPUnit袖珍指南-第三章 PHPUnit的目的
- PHPUnit袖珍指南-第三章 PHPUnit的目的
- PHPUnit袖珍指南-第二章 自动测试
- PHPUnit袖珍指南 第六章 装置器
- PHPUnit袖珍指南 第八章 未完成测试
- PHPUnit袖珍指南 第十一章 残根
- PHPUnit袖珍指南-第二章 自动测试
- PHPUnit袖珍指南 第六章 装置器
- PHPUnit袖珍指南 第八章 未完成测试
- PHPUnit袖珍指南 第十一章 残根
- PHPUnit袖珍指南-第一章 简介
- PHPUnit袖珍指南-第一章 简介
- PHPUnit袖珍指南-第五章 命令行测试工具
- PHPUnit袖珍指南 第七章 测试异常和性能回归
- 将一个数转成8的倍数
- Java随机产生数组元素并无重复元素方法
- 题目 2 最大子序列和问题
- 关于Unix/Linux下查看命令行历史记录(history/.bash_history)
- PHPUnit袖珍指南-第三章 PHPUnit的目的
- PHPUnit袖珍指南-第四章 安装PHPUnit
- linux文件内容查看(cat,tac,nl,more,less,head,tail,od)
- linux wait_queue/work_queue
- IOS开发之将以NSDictoray组织的NSArray中以其中的NSDate大小来排序
- 分层开发思想与小笼包
- PHPUnit袖珍指南-第五章 命令行测试工具
- 字符串转时间(time_t)
- UVa 10382 Watering Grass
- PHPUnit袖珍指南 第六章 装置器