MikeAAG/phpunit-3.5.15

PHPUnit v3.5.15,兼容 ZendFramework 1.12.20

3.5.15 2017-04-20 08:22 UTC

This package is auto-updated.

Last update: 2024-09-21 22:32:14 UTC


README

PHPUnit 是 PHP 项目中事实上的单元测试标准。它提供了一套框架,使测试的编写变得简单,同时提供了轻松运行测试和分析结果的功能。

安装

PHPUnit 应使用 PEAR 安装程序 安装。此安装程序是 PEAR 的核心,它为 PHP 包提供分发系统,并随 PHP 4.3.0 及以后的每个版本一起发布。

用于分发 PHPUnit 的 PEAR 频道(pear.phpunit.de)需要与本地 PEAR 环境注册。此外,PHPUnit 所依赖的组件托管在额外的 PEAR 频道中。

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com

这只需要做一次。现在可以使用 PEAR 安装程序从 PHPUnit 频道安装软件包

pear install phpunit/PHPUnit

安装后,您可以在本地 PEAR 目录中找到 PHPUnit 源文件;路径通常是 /usr/lib/php/PHPUnit

文档

PHPUnit 的文档可用在不同格式

邮件列表

  • user-subscribe@phpunit.de 发送电子邮件以订阅 phpunit-user 邮件列表。这是一个中等流量的列表,用于一般 PHPUnit 支持;在这里提出 PHPUnit 问题。
  • dev-subscribe@phpunit.de 发送电子邮件以订阅 phpunit-dev 邮件列表。这是一个低流量的列表,供那些想帮助 PHPUnit 开发的人使用。

IRC

Freenode IRC 网络上的 #phpunit 频道是讨论 PHPUnit 的地方。

从 Git Checkout 使用 PHPUnit

以下命令可用于从 Git 执行 PHPUnit 及其依赖项的初始检出

mkdir phpunit && cd phpunit
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

需要将 dbunitphp-code-coveragephp-file-iteratorphp-text-templatephp-timerphp-token-streamphpunitphpunit-mock-objectsphpunit-selenium 目录添加到 include_path

可以使用 phpunit/phpunit.php 脚本来调用 PHPUnit 测试运行器。

以下命令可用于检出适用于 PHPUnit 3.5 的适当分支

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

以下命令可用于检出适用于 PHPUnit 3.6 的适当分支

cd phpunit && git checkout master && cd ..
cd dbunit && git checkout master && cd ..
cd php-file-iterator && git checkout master && cd ..
cd php-code-coverage && git checkout master && cd ..
cd php-token-stream && git checkout master && cd ..
cd phpunit-mock-objects && git checkout master && cd ..
cd phpunit-selenium && git checkout master && cd ..