- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章PHPUnit PHP测试框架安装方法由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
单元测试是几个现代敏捷开发方法的基础,使得PHPUnit成为许多大型PHP项目的关键工具。这个工具也可以被Xdebug扩展用来生成代码覆盖率报告 ,并且可以与phing集成来自动测试,最后它还可以和Selenium整合来完成大型的自动化集成测试。 Windows平台LAMP环境XAMPP 1.7.3下如何安装PHPUnit呢? 首先,以管理员身份运行cmd,使用pear添加phpunit频道: D:\xampp\php>pear channel-discover pear.phpunit.de Channel "pear.phpunit.de" is already initialized 频道添加好,尝试安装PHPUnit: D:\xampp\php>pear install phpunit/PHPUnit Unknown remote channel: pear.symfony-project.com Unknown remote channel: pear.symfony-project.com Unknown remote channel: components.ez.no Unknown remote channel: components.ez.no phpunit/PHPUnit requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/DbUnit requires PEAR Installer (version >= 1.9.1), installed version is1.9.0 phpunit/DbUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/File_Iterator requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHP_CodeCoverage requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.2.2) phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5) phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0 phpunit/PHP_TokenStream requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) No valid packages found install failed 从提示看出,需要安装PEAR 1.9.1,而当前PEAR是1.9.0,那就要先升级PEAR版本。 pear list-upgrades可以列出当前可用的更新, D:\xampp\php>pear.bat list-upgrades WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update D:\xampp\php>pear channel-update pear.php.net Updating channel "pear.php.net" Update of Channel "pear.php.net" succeeded D:\xampp\php>pear.bat list-upgrades PEAR.PHP.NET AVAILABLE UPGRADES (STABLE): ========================================= CHANNEL PACKAGE LOCAL REMOTE SIZE pear.php.net Archive_Tar 1.3.3 (stable) 1.3.7 (stable) 17.2kB pear.php.net Console_Getargs 1.3.4 (stable) 1.3.5 (stable) 17.8kB pear.php.net Mail 1.1.14 (stable) 1.2.0 (stable) 23kB pear.php.net Mail_Mime 1.5.2 (stable) 1.8.1 (stable) 31kB pear.php.net Mail_mimeDecode 1.5.1 (stable) 1.5.5 (stable) 11.4kB pear.php.net Net_SMTP 1.3.4 (stable) 1.4.4 (stable) 12.1kB pear.php.net Net_Socket 1.0.9 (stable) 1.0.10 (stable) 5.3kB pear.php.net PEAR 1.9.0 (stable) 1.9.1 (stable) 287kB pear.php.net Structures_Graph 1.0.3 (stable) 1.0.4 (stable) 30kB Channel pear.phpunit.de: No upgrades available ZEND.GOOGLECODE.COM/SVN AVAILABLE UPGRADES (STABLE): ==================================================== CHANNEL PACKAGE LOCAL REMOTE SIZE zend.googlecode.com/svn zend 1.9.6 (stable) 1.11.1 (stable) - 更新所有可用更新: D:\xampp\php>pear upgrade-all Will upgrade channel://pear.php.net/archive_tar Will upgrade channel://pear.php.net/console_getargs Will upgrade channel://pear.php.net/mail Will upgrade channel://pear.php.net/mail_mime Will upgrade channel://pear.php.net/mail_mimedecode Will upgrade channel://pear.php.net/net_smtp Will upgrade channel://pear.php.net/net_socket Will upgrade channel://pear.php.net/pear Will upgrade channel://pear.php.net/structures_graph Will upgrade channel://zend.googlecode.com/svn/zend Did not download optional dependencies: pear/Auth_SASL, use --alldeps to download automatically pear/Net_SMTP can optionally use package "pear/Auth_SASL" downloading Archive_Tar-1.3.7.tgz ... Starting to download Archive_Tar-1.3.7.tgz (17,610 bytes) ......done: 17,610 bytes downloading Console_Getargs-1.3.5.tgz ... Starting to download Console_Getargs-1.3.5.tgz (18,207 bytes) ...done: 18,207 bytes downloading Mail-1.2.0.tgz ... Starting to download Mail-1.2.0.tgz (23,214 bytes) ...done: 23,214 bytes downloading Mail_Mime-1.8.1.tgz ... Starting to download Mail_Mime-1.8.1.tgz (31,530 bytes) ...done: 31,530 bytes downloading Mail_mimeDecode-1.5.5.tgz ... Starting to download Mail_mimeDecode-1.5.5.tgz (11,554 bytes) ...done: 11,554 bytes downloading Net_SMTP-1.4.4.tgz ... Starting to download Net_SMTP-1.4.4.tgz (12,264 bytes) ...done: 12,264 bytes downloading Net_Socket-1.0.10.tgz ... Starting to download Net_Socket-1.0.10.tgz (5,429 bytes) ...done: 5,429 bytes downloading PEAR-1.9.1.tgz ... Starting to download PEAR-1.9.1.tgz (293,587 bytes) ...done: 293,587 bytes downloading Structures_Graph-1.0.4.tgz ... Starting to download Structures_Graph-1.0.4.tgz (30,318 bytes) ...done: 30,318 bytes downloading Zend-1.11.1.tgz ... Starting to download Zend-1.11.1.tgz (3,638,888 bytes) ...done: 3,638,888 bytes upgrade-all ok: channel://pear.php.net/Archive_Tar-1.3.7 upgrade-all ok: channel://pear.php.net/Console_Getargs-1.3.5 upgrade-all ok: channel://pear.php.net/Mail-1.2.0 upgrade-all ok: channel://pear.php.net/Mail_Mime-1.8.1 upgrade-all ok: channel://pear.php.net/Net_Socket-1.0.10 upgrade-all ok: channel://pear.php.net/Structures_Graph-1.0.4 upgrade-all ok: channel://zend.googlecode.com/svn/Zend-1.11.1 upgrade-all ok: channel://pear.php.net/Mail_mimeDecode-1.5.5 upgrade-all ok: channel://pear.php.net/Net_SMTP-1.4.4 upgrade-all ok: channel://pear.php.net/PEAR-1.9.1 PEAR: Optional feature webinstaller available (PEAR's web-based installer) PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer) PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer) PEAR: To install optional features use "pear install pear/PEAR#featurename" 更新成功后,PEAR已经是1.9.1版了,现在可以放心地安装PHPUnit了: D:\xampp\php>pear install phpunit/PHPUnit Unknown remote channel: pear.symfony-project.com Unknown remote channel: pear.symfony-project.com Unknown remote channel: components.ez.no Unknown remote channel: components.ez.no phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/DbUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/PHP_CodeCoverage requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5) phpunit/PHP_TokenStream requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) downloading File_Iterator-1.2.3.tgz ... Starting to download File_Iterator-1.2.3.tgz (3,406 bytes) ....done: 3,406 bytes downloading PHPUnit_MockObject-1.0.3.tgz ... Starting to download PHPUnit_MockObject-1.0.3.tgz (17,333 bytes) ...done: 17,333 bytes downloading PHPUnit_Selenium-1.0.1.tgz ... Starting to download PHPUnit_Selenium-1.0.1.tgz (15,285 bytes) ...done: 15,285 bytes install ok: channel://pear.phpunit.de/File_Iterator-1.2.3 install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.0.3 install ok: channel://pear.phpunit.de/PHPUnit_Selenium-1.0.1 上面信息来看,还是没有安装成功,pear.symfony-project.com和components.ez.no两个频道也要添加一下: D:\xampp\php>pear channel-discover pear.symfony-project.com Adding Channel "pear.symfony-project.com" succeeded Discovery of channel "pear.symfony-project.com" succeeded D:\xampp\php>pear channel-discover components.ez.no Adding Channel "components.ez.no" succeeded Discovery of channel "components.ez.no" succeeded 再次尝试安装PHPUnit: D:\xampp\php>pear install phpunit/PHPUnit phpunit/PHPUnit can optionally use PHP extension "dbus" phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5) downloading PHPUnit-3.5.5.tgz ... Starting to download PHPUnit-3.5.5.tgz (116,148 bytes) ....................done: 116,148 bytes downloading DbUnit-1.0.0.tgz ... Starting to download DbUnit-1.0.0.tgz (38,183 bytes) ...done: 38,183 bytes downloading PHP_CodeCoverage-1.0.2.tgz ... Starting to download PHP_CodeCoverage-1.0.2.tgz (109,280 bytes) ...done: 109,280 bytes downloading YAML-1.0.4.tgz ... Starting to download YAML-1.0.4.tgz (9,919 bytes) ...done: 9,919 bytes downloading ConsoleTools-1.6.1.tgz ... Starting to download ConsoleTools-1.6.1.tgz (869,994 bytes) ...done: 869,994 bytes downloading PHP_TokenStream-1.0.1.tgz ... Starting to download PHP_TokenStream-1.0.1.tgz (7,250 bytes) ...done: 7,250 bytes downloading Base-1.8.tgz ... Starting to download Base-1.8.tgz (236,357 bytes) ...done: 236,357 bytes install ok: channel://pear.symfony-project.com/YAML-1.0.4 install ok: channel://components.ez.no/Base-1.8 install ok: channel://pear.phpunit.de/DbUnit-1.0.0 install ok: channel://components.ez.no/ConsoleTools-1.6.1 install ok: channel://pear.phpunit.de/PHP_TokenStream-1.0.1 install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.0.2 install ok: channel://pear.phpunit.de/PHPUnit-3.5.5 PHPUnit安装成功!!! 。
最后此篇关于PHPUnit PHP测试框架安装方法的文章就讲到这里了,如果你想了解更多关于PHPUnit PHP测试框架安装方法的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
我想了解 Ruby 方法 methods() 是如何工作的。 我尝试使用“ruby 方法”在 Google 上搜索,但这不是我需要的。 我也看过 ruby-doc.org,但我没有找到这种方法。
Test 方法 对指定的字符串执行一个正则表达式搜索,并返回一个 Boolean 值指示是否找到匹配的模式。 object.Test(string) 参数 object 必选项。总是一个
Replace 方法 替换在正则表达式查找中找到的文本。 object.Replace(string1, string2) 参数 object 必选项。总是一个 RegExp 对象的名称。
Raise 方法 生成运行时错误 object.Raise(number, source, description, helpfile, helpcontext) 参数 object 应为
Execute 方法 对指定的字符串执行正则表达式搜索。 object.Execute(string) 参数 object 必选项。总是一个 RegExp 对象的名称。 string
Clear 方法 清除 Err 对象的所有属性设置。 object.Clear object 应为 Err 对象的名称。 说明 在错误处理后,使用 Clear 显式地清除 Err 对象。此
CopyFile 方法 将一个或多个文件从某位置复制到另一位置。 object.CopyFile source, destination[, overwrite] 参数 object 必选
Copy 方法 将指定的文件或文件夹从某位置复制到另一位置。 object.Copy destination[, overwrite] 参数 object 必选项。应为 File 或 F
Close 方法 关闭打开的 TextStream 文件。 object.Close object 应为 TextStream 对象的名称。 说明 下面例子举例说明如何使用 Close 方
BuildPath 方法 向现有路径后添加名称。 object.BuildPath(path, name) 参数 object 必选项。应为 FileSystemObject 对象的名称
GetFolder 方法 返回与指定的路径中某文件夹相应的 Folder 对象。 object.GetFolder(folderspec) 参数 object 必选项。应为 FileSy
GetFileName 方法 返回指定路径(不是指定驱动器路径部分)的最后一个文件或文件夹。 object.GetFileName(pathspec) 参数 object 必选项。应为
GetFile 方法 返回与指定路径中某文件相应的 File 对象。 object.GetFile(filespec) 参数 object 必选项。应为 FileSystemObject
GetExtensionName 方法 返回字符串,该字符串包含路径最后一个组成部分的扩展名。 object.GetExtensionName(path) 参数 object 必选项。应
GetDriveName 方法 返回包含指定路径中驱动器名的字符串。 object.GetDriveName(path) 参数 object 必选项。应为 FileSystemObjec
GetDrive 方法 返回与指定的路径中驱动器相对应的 Drive 对象。 object.GetDrive drivespec 参数 object 必选项。应为 FileSystemO
GetBaseName 方法 返回字符串,其中包含文件的基本名 (不带扩展名), 或者提供的路径说明中的文件夹。 object.GetBaseName(path) 参数 object 必
GetAbsolutePathName 方法 从提供的指定路径中返回完整且含义明确的路径。 object.GetAbsolutePathName(pathspec) 参数 object
FolderExists 方法 如果指定的文件夹存在,则返回 True;否则返回 False。 object.FolderExists(folderspec) 参数 object 必选项
FileExists 方法 如果指定的文件存在返回 True;否则返回 False。 object.FileExists(filespec) 参数 object 必选项。应为 FileS
我是一名优秀的程序员,十分优秀!