2012-11-19 65 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 –