2012-11-19 67 views
0

大家好我對這個問題經歷了許多相關的問題,但我仍然無法得到解決方案。我已經安裝了Zend Server。現在我想安裝PHPunit。我已安裝pear,然後安裝PHPUnit在zend服務器上安裝phpunit

我的Zend服務器安裝在

C:\xyz\zend\ZendServer 

我的梨被安裝在

C:\xyz\zend\ZendServer\bin\PEAR 

並且PHPUnit會被安裝在

C:\xyz\zend\ZendServer\bin\PEAR\pear\PHPUnit 

我已經加入pear路徑,甚至PHPUnit的路徑到Envrionmental PATH變量。然後我打開php.ini位於

C:\xyz\zend\ZendServer\etc 

,幷包含路徑設置爲

include_path = ".;c:\php\includes;c:\xyz\zend\ZendServer\bin\PEAR\pear;c:\xyz\zend\ZendServer\bin\PEAR\pear\PHPUnit" 

現在,當我在CMD運行命令來創建zend的項目,創建項目,但我發現這個還要注意

Testing Note: PHPUnit was not found in your include_path, therefore no testing action will be created. 

有人請告訴我我做錯了什麼和設置這個包括路徑?

問候:-)

+0

嘗試刪除調試代碼PHPUnit.bat在Windows – opHASnoNAME

+0

添加到您的Systempath下你真的確認PHPUnit的可以在'C發現:\某某\ Zend的\ ZendServer對其進行訪問\ BIN \ PEAR \梨'目錄?如果您查看該目錄,您應該看到一個名爲PHPUnit的目錄,並且它應該是PHPUnit php src文件。我問,因爲PHPUnit與* bin *目錄是不常見的。 –

+0

@BullfrogBlues是的,我很確定:-) –

回答

2

讓我們做一些老學校的調試:)

$ zf create project ./one 
Creating project at /path/to/one 
Note: This command created a web project, for more information setting up your VHOST, please see docs/README 
Testing Note: PHPUnit was not found in your include_path, therefore no testing actions will be created. 

沒有PHPUnit的!

找到path/zend-framework/bin/zf.php並添加接近頂部:

var_dump(get_include_path()); 

現在讓我們來看看包含路徑是這樣的:

$ zf create project ./two 
string(32) ".:/usr/share/php" 
Creating project at /path/to/two 
Note: This command created a web project, for more information setting up your VHOST, please see docs/README 
Testing Note: PHPUnit was not found in your include_path, therefore no testing actions will be created 

我PHPUnit的不在/usr/share/php目錄。讓我們通過將PHPUnit添加到包含路徑來解決這個問題。

例如如果PHPUnit位於/path/to/phpunit中,請打開php.ini文件並將其添加到包含路徑中。

第三次魅力:

$ zf create project ./three 
string(56) ".:/usr/share/php:/path/to/phpunit" 
Creating project at /path/to/three 
Note: This command created a web project, for more information setting up your VHOST, please see docs/README 

如果您已經編輯了正確的php.ini,您添加到zf.phpvar_dump()現在呼應包括與任何路徑將它修改爲,這在我的情況下,它是正確,所以現在PHPUnit正在工作。

現在從zf.php

+0

非常好的解釋。 +1 –