Install phpunit on Ubuntu

Source: Internet
Author: User

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

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.