Unit testing is the foundation of several modern agile development methods, making phpunit a key tool for many large PHP projects. This tool can also be used by Xdebug extensions to generate code coverage reports, and can be integrated with phing for automated testing, and eventually it can be integrated with selenium to complete large-scale automated integration testing.
Windows platform Lamp Environment XAMPP 1.7.3 How do I install phpunit?
First, run CMD as an administrator and add the PHPUnit channel using pear:
D:\xampp\php>pear Channel-discover pear.phpunit.de
Channel "Pear.phpunit.de" is already initialized
Channel add good, try to install PHPUnit:
D:\xampp\php>pear Install Phpunit/phpunit
Unknown Remote channel:pear.symfony-project.com
Unknown Remote channel:pear.symfony-project.com
Unknown Remote channel:components.ez.no
Unknown Remote channel:components.ez.no
Phpunit/phpunit requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/phpunit requires package "Channel://pear.symfony-project.com/yaml" (Version >= 1.0.2)
Phpunit/phpunit can optionally use PHP extension "Dbus"
Phpunit/dbunit requires PEAR Installer (version >= 1.9.1), installed version is1.9.0
Phpunit/dbunit requires package "Channel://pear.symfony-project.com/yaml" (Version >= 1.0.2)
Phpunit/file_iterator requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/php_codecoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/php_codecoverage requires package "Channel://components.ez.no/consoletools" (version >= 1.6)
Phpunit/php_codecoverage requires package "Phpunit/file_iterator" (Version >= 1.2.2)
Phpunit/php_codecoverage can optionally use PHP extension "Xdebug" (Version >= 2.0.5)
Phpunit/phpunit_mockobject requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/phpunit_selenium requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/php_tokenstream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
Phpunit/php_tokenstream requires package "Channel://components.ez.no/consoletools" (version >= 1.6)
No Valid packages found
Install failed
As you can see from the hint, you need to install Pear 1.9.1, and now Pear is 1.9.0, you should upgrade the Pear version first.
Pear List-upgrades can list the updates that are currently available.
D:\xampp\php>pear.bat List-upgrades
Warning:channel "Pear.php.net" has updated its protocols, with "Pear channel-update pear.php.net" to
Update
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.