The command to install pear is as follows: $ wget Http://pear.php.net/go-pear.phar $ php Go-pear.phar
Pear installation is successful!
Use Pear to install PHPUnit
Pear channel-discover pear.phpunit.de pear channel-discover components.ez.no Pear channel-discover Pear.symfony-project.com
Pear upgrade-all Pear Install phpunit/phpunit
Dependent packages may appear during installation and follow the prompts to install them. such as: Yum install php-dom-y Example: a.php <?php class Stacktest extends Phpunit_framework_testcase {public Function TESTP Ushandpop () {$stack = array (); $this->assertequals (0, Count ($stack)); Array_push ($stack, ' foo '); $this->assertequals (' foo ', $stack [count ($stack)-1]); $this->assertequals (1, Count ($stack)); $this->assertequals (' foo ', Array_pop ($stack)); $this->assertequals (0, Count ($stack)); }?> phpunit a.php see OK, indicating success the basic process is over
CentOS---phpunit installation process