2011-12-13 141 views
0

這是我在終端上的命令,我得到的通知消息注:PHPUnit的是爲了產生控制器測試存根要求

Note: PHPUnit is required in order to generate controller test stubs. 

[email protected]:/var/www/register$ zf create action root Authentication 

Note: PHPUnit is required in order to generate controller test stubs. 

Creating an action named root inside controller at /var/www/register/application/controllers/AuthenticationController.php 
Updating project profile '/var/www/register/.zfproject.xml' 
Creating a view script for the root action method at /var/www/register/application/views/scripts/authentication/root.phtml 
Updating project profile '/var/www/register/.zfproject.xml' 

這是我的include_path中:

include_path .:/usr/share/php:/usr/share/pear 

我不不知道我在這裏做錯了什麼。

我也想知道phpUnit有什麼用?

回答

1

這就是它所說的。如果您想創建測試存根,則需要安裝PHPUnit。當您生成代碼時,Zend可以自動爲您創建測試。這不是錯誤或通知(如E_NOTICE),它只是一個注意

PHPUnit是一個單元測試框架,可幫助您測試您的代碼。如果您不知道這意味着什麼,請務必閱讀PHPUnit documentation

+0

:)我需要在這裏添加include_path。:/ usr/share/php:/ usr/share/pear – John

+0

您是否安裝了PHPUnit? – deceze

+0

:)我不知道我不是系統的主人,所以我該如何檢查? – John

-2
First, install PEAR. 

sudo apt-get install php-pear 
Next, tell PEAR to update its own channel. 

sudo pear channel-update pear.php.net 
Then, tell PEAR to upgrade itself to the newest version. 

sudo pear upgrade-all 
You should now have the newest version of PEAR installed. 

To install PHPUnit, let PEAR know where to find PHPUnit. 

sudo pear channel-discover pear.phpunit.de 
Then install PHPUnit. (the -a makes sure all dependency packages are also installed) 

sudo pear install -a phpunit/PHPUnit 

更新:

在最後重啓Apache

sudo /etc/init.d/apache2 restart 

喔您正在使用Zend Framework

phpunit is installed in 
C:\Zend\ZendServer\bin\PEAR 

添加此行

include_path=".:/usr/share/php:/usr/share/pear:/usr/share/php/PHPunit:/usr/share/php/PEAR"

+0

我需要在這裏添加include_path。:/ usr/share/php:/ usr/share/pear – John

+1

只需在終端上鍵入phpunit並查看是否存在 – Harsh

相關問題