我使用的是Windows 7。
我过去在这个系统上使用过PHPUnit。
在开始一个新项目时,我在第一次尝试运行测试时遇到上述错误。
我已经清除了梨上的缓存,完全卸载了" - force --alldeps"重新安装了PHPUnit和所有依赖项 - 包括PHP_CodeCoverage。
没有从头开始重写梨 - 任何人都有任何想法如何解决这个问题?
[edit]以下是" pear config-show"的输出。和"梨信息phpunit / PHPUnit"命令
C:\Users\Jim\Documents\code\seleniumtests\phpunit\common>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels auto_discover 1
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR
PEAR documentation directory doc_dir C:\php5\pear\docs
PHP extension directory ext_dir C:\Program Files
(x86)\Zend\ZendServer\lib\phpext
PEAR directory php_dir C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\pear
PEAR Installer cache directory cache_dir C:\Users\Jim\AppData\Local\Temp\pear\cache
PEAR configuration file cfg_dir C:\php5\pear\cfg
directory
PEAR data directory data_dir C:\php5\pear\data
PEAR Installer download download_dir C:\Users\Jim\AppData\Local\Temp\pear\download
directory
PHP CLI/CGI binary php_bin C:\Program Files
(x86)\Zend\ZendServer\bin\php.exe
php.ini location php_ini <not set>
--program-prefix passed to php_prefix <not set>
PHP's ./configure
--program-suffix passed to php_suffix <not set>
PHP's ./configure
PEAR Installer temp directory temp_dir C:\Users\Jim\AppData\Local\Temp\pear\temp
PEAR test directory test_dir C:\php5\pear\tests
PEAR www files directory www_dir C:\php5\pear\www
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 0
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin C:\Program Files
(x86)\Git\bin\gpg.EXE
Signature Key Directory sig_keydir C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\pear.ini\pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\pear.ini\pear.ini
System Configuration File Filename C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\pear.ini\pearsys.ini
C:\Users\Jim\Documents\code\seleniumtests\phpunit\common>pear info phpunit/PHPUnit
ABOUT PEAR.PHPUNIT.DE/PHPUNIT-3.6.10
====================================
Release Type PEAR-style PHP-based Package
Name PHPUnit
Channel pear.phpunit.de
Summary The PHP Unit Testing framework.
Description The PHP Unit Testing framework.
Maintainers Sebastian Bergmann <sebastian@phpunit.de> (lead)
Release Date 2012-01-27 10:49:19
Release Version 3.6.10 (stable)
API Version 3.6.0 (stable)
License BSD License
Release Notes http://github.com/sebastianbergmann/phpunit/blob/master/README.markdown
Required Dependencies PHP version 5.2.7
PEAR installer version 1.9.4 or newer
Package pear.phpunit.de/File_Iterator
Version 1.3.0 or newer
Package pear.phpunit.de/Text_Template
Version 1.1.1 or newer
Package pear.phpunit.de/PHP_CodeCoverage
Version 1.1.0 or newer
Package pear.phpunit.de/PHP_Timer
Version 1.0.1 or newer
Package pear.phpunit.de/PHPUnit_MockObject
Version 1.1.0 or newer
Package pear.symfony-project.com/YAML
Version 1.0.2 or newer
Extension dom
Extension pcre
Extension reflection
Extension spl
Optional Dependencies Package pear.phpunit.de/PHP_Invoker
Version 1.1.0 or newer
Extension json
Extension simplexml
Extension tokenizer
package.xml version 2.0
Last Modified 2012-03-17 16:52
Previous Installed - None -
Version
答案 0 :(得分:2)
最后,我访问了http://pear.phpunit.de/并下载了最新的PHP_CodeCoverage和PHPUnit_Selenium tar.gz文件,解压缩了它们,并将所有文件复制到我的PHPUnit安装目录中的匹配文件夹位置。
这似乎已经成功了!