In window, use pear to install phpunit1. install pear1) in the command line, enter the php installation directory, for example, my Directory D: phpZendZendServerbin. run go-pear if the following error occurs: pharD: install phpunit with pear in phpZendZendServerbinPEARgo-pear.phardoesnothaveasignatur window
1. install pear
1) in the command line, go to the php installation directory, such as my Directory D: \ php \ Zend \ ZendServer \ bin, and run:
Go-pear
If the following error occurs:
Phar "D: \ php \ Zend \ ZendServer \ bin \ PEAR \ go-pear.phar" does not have a signature
Warning: require_once (phar: // go-pear.phar/index. php): failed to open stream: pha
R error: invalid url or non-existent phar "phar: // go-pear.phar/index. php" in D :\
Php \ Zend \ ZendServer \ bin \ PEAR \ go-pear.phar on line 1236
Solution: Open the php. ini file and add phar. require_hash = Off to the last line.
4) in this case, pear should be installed successfully and updated to the latest version:
Pear upgrade-all
(This step is very important. phpunit seems to be installed using pear 1.9.x)
2. install phpunit:
1) add a phpunit Channel
Pear channel-discover pear.phpunit.de
Pear channel-discover components. ez. no
Pear channel-discover pear.symfony-project.com
2) installation:
Pear install phpunit/PHPUnit
If this error occurs:
Fatal error: require_once (): Failed opening required 'ures ures/Graph. php'
The solution is as follows:
Http://download.pear.php.net/package/Structures_Graph-1.0.3.tgz
Decompress and copy the Structures directory to D: \ php \ Zend \ ZendServer \ bin \ PEAR.
If:
Cocould not extract the package. xml file
Error: cannot download "phpunit/XXXX"
The path to the pear download directory may contain spaces such as: D:/program files/
The solution is as follows:
Pear config-set temp_dir "C: \ tmp"
Pear config-set download_dir "C: \ tmp"
Here, you can set the directory path without spaces. it doesn't matter where you want to set it.
Finally, test whether the installation is successful. run the following command in cmd:
Phpunit
3. integrate phpunit with zendStudio8
1) create a new project in zend studio.
2) right-click the project and select "Properties". in the displayed Properties box, select "PHP Include Path"> "Libraries"> "Add Library" and select "PHPUnit 3.x.