2012-03-17 10 views
0

私は過去にこのシステム上のPHPUnitの罰金を使用していたのWindows 7にPHPUnitは、「未定義のメソッドPHP_CodeCoverage_Filterに呼び出し::のgetInstance()」を与える

を使用しています。

新しいプロジェクトを開始すると、最初にテストを実行しようと試みたときにエラーが発生します。

私はpearでキャッシュをクリアして、完全にアンインストールしました。 "--force --alldeps"はPHPUnitとPHP_CodeCoverageを含むすべての依存関係を再インストールしました。

梨を一から書き直すのに手間がかかりません - これをどのように修正できるのか誰にでも分かりますか?

以下[編集]「梨の設定・ショー」の出力と「梨の情報は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 <[email protected]> (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

'/ usr/bin/phpunit'を削除して再インストールしてください。それが新たに作成されたことを確認し、 'PHP_CodeCoverage_Filter'をまったく言及しません。 –

+0

Davidに感謝します。残念ながら、Windowsは/ usr/binをまったく持っていません。私はすでにアンインストールして再インストールしました。 – Hippyjim

+0

D'oh!私はWindows 7についての最初の行を見逃していました。私の推測では、システムまたはユーザーPATH上に古いインストールがあることです。コマンドラインで 'phpunit'とタイプして削除したときに実行される' phpunit.bat'を見つける必要があります。 –

答えて

2

コマンドですが、私はhttp://pear.phpunit.de/を訪問し、最新のPHP_CodeCoverageとPHPUnit_Seleniumタールをダウンロード.gzファイルを展開し、それらのファイルを解凍して、内部のすべてのファイルをPHPUnitのインストールディレクトリ内の対応するフォルダの場所にコピーしました。

これはトリックを行ったようです!

+0

あなたのPHPUnitインストールディレクトリはどれですか?同じ問題を抱えており、同じディレクトリを見つけるための正しいディレクトリを見つけることができません。 – peipst9lker

関連する問題