Question

Hi All I have gone through many related question to this problem but I am still unable to get the solution. I have installed Zend Server. Now I want to install PHPunit. I have installed pear and then installed PHPUnit.

My Zend Server is installed at

C:\xyz\zend\ZendServer

My pear is installed at

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

And PHPunit is installed at

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

I have added pear path and even PHPUnit path to Envrionmental PATH variable. Then I opened php.ini located at

C:\xyz\zend\ZendServer\etc

and set include_path as

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

Now When I run command at cmd to create zend project, the project is created but I found this note too

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

Some one please tell me what Am I doing wrong and where to set this include path???

Best Regards :-)

Was it helpful?

Solution

Let's do some old school debugging :)

$ 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.

No PHPUnit!

Locate path/zend-framework/bin/zf.php and add near the top:

var_dump(get_include_path());

Now let's see what the include path looks like:

$ 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

My PHPUnit isn't in the /usr/share/php directory. Let's resolve that by adding PHPUnit to the include path.

e.g. If PHPUnit is in /path/to/phpunit, open the php.ini file and add it to the include path.

Third times a charm:

$ 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

If you've edited the correct php.ini, the var_dump() you added to zf.php will now echo the include path with whatever you modified it to, which in my case it was correct, so now PHPUnit is working.

Now remove the debug code from zf.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top