1

Zend/PHPUnit のインストールが機能している人は、PHPUnit.bat の読み方を教えてもらえますか?

PEAR と PHPUnit をインストールしましたが、PHPUnit.bat のコードにエラーがあるようです。

いくつかの問題を解決した結果、 「PHPUnit は認識されたコマンドではありません」というエラーは表示されなくなりました。しかし、コマンドラインで「PHPUnit」を呼び出すと、コマンドプロンプトが再表示される以外は何も起こりません。一部のコードが実行された可能性があることを示します。

いくつか読んだところ、PEAR は 'c:\zend\zendServer\bin' にある .bat ファイルを呼び出しているはずです。これを開くと、非常に短いコード ブロックがあります。

if "%PHPBIN%" == "" set PHPBIN=c:\zend\zendserver\bin\php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "C:\Zend\zendServer\bin\\phpunit" %*

最後の行、特にダブル スラッシュが間違っているように見えます。「bin\pear\phpunit など」などのさまざまな派生を試しましたが、これがどこを指しているのかわかりません。

ZendServer/PHPUnit のインストールが機能している人は誰でも、この行の読み方を教えてもらえますか?

また、パッケージが正しくインストールされているかどうかをテストする最良の方法は、コマンド行で「 PHPunit 」を呼び出すことです。アイデアを歓迎します。PEAR インストール コールは、インストールが正常に機能することを示唆しています。

更新 zend フレームワーク CLI ツールを使用して新しいプロジェクトを作成したところ、include_path に PHPUnit が見つからないというメモが表示されました。インクルード パスに PEAR と PHP の両方があります。

更新 私は潜在的なテストでこの投稿を見つけましたPHPUnit Working - インクルード パスが正しく設定されていませんか? 、phpUnit をテストする方法を提供します。提案された PHP スクリプトを htdocs フォルダーに保存し、PHPUnit で呼び出してみました。PHPUnit.bat ファイルにエラーがあることを示唆しているようです。

4

1 に答える 1

0

Okay this has been a nightmare, but I think I have a solution for anyone facing the same issues.

Question One: how do I test if PHPUNit is working. Answer: typing PHPUnit into the cmd line will give you a list of all the commands and so acts as a good test as to whether the install has worked.

Question Two: What should PHPUnit.bat look like.

The text above is correct and the extra slash in PHP.bat does not affect the output as ta.speot.is notes.

Solution to get install working:

The issue in this case related to an anomaly with Zend Server. A change to the php config file PHP.ini does not seem to get picked up by the server. It appears that Zend stores the path variables somewhere else. I noted that the changes to the include_path had not been picked up and changed it through the GUI server interface provided with the install.

PHPUnit is now working correctly.

For those struggling with an install I would add two lessons to add to the huge range of posts on the topic.

1) if you have ever had Zend on your computer. Beware an uninstall leaves trace files that can complicate later installs.

2) There is PHPUnit.ini file that gets saved in the c:\windows directory be sure to delete this before starting the install.

3) The following link is an excellent set of instructions http://www.zendexperts.com/2011/06/21/how-to-install-zend-server-ce-pear-phpunit/.

The only change I would make is when using go-pear.php to install PEAR, do not activate errors as suggested in the post, otherwise the interface does not seem to work and issues a large number of errors in the PEAR php.

Hope this helps someone save a couple of days.

于 2012-11-18T01:57:52.820 に答える