What is phpunit?
Phpunit is a lightweight PHP testing framework. It is a full migration of the junit3 series under PhP5 and a member of the xunit testing framework family (both of them are based on the pattern pioneer Kent Beck's design)
Install on Ubuntu
Sudo apt-Get install phpunit
Verify that phpunit is successfully installed. Enter phpunit in the command line.
$ Phpunit
Installation successful print:
Phpunit 3.6.11 by Sebastian Bergmann.
Usage: phpunit [Switches] unittest [unittest. php]
Phpunit [Switches] <directory>
If the following error occurs.
PHP warning: require_once (PHP/codecoverage/filter. php): failed to open stream: no such file or directory in/usr/bin/phpunit on line 39
PHP fatal error: require_once (): Failed opening required' PHP/codecoverage/filter. PHP '(include_path = '. :/usr/share/PHP:/usr/share/pear ') in/usr/bin/phpunit on line 39
Update Chanel and pear from Debian and UbuntuCommunity. Test availability
Sudo apt-Get remove phpunit
Sudo pear channel-discover pear.phpunit.de
Sudo pear channel-discover pear.symfony-project.com
Sudo pear channel-discover components. EZ. No
Sudo pear update-Channels
Sudo pear upgrade-all
Sudo pear install -- alldeps phpunit/phpunit