PHPUnit pocket guide for PHPUnit installation

Source: Internet
Author: User
PhpUnit can be obtained through PHP extension and library (PEAE. PEAR is a framework and distribution system for reusable PHP components. You can run the PEAR installer command to install PHPUnit: pearinstallPHPUnit2 is named according to the PEAR version naming standard. the PHPUnit package for PHP5 is called phpunit2. PHPUnit is a package for PHP4, which is described later in this book. "in PHP4, this phpUnit can be obtained through PHP extensions and Libraries (PEAE. PEAR is a framework and distribution system for reusable PHP components. To install PHPUnit, run the PEAR installer command:

Pear install PHPUnit2

According to the PEAR version naming standard, the PHPUnit package for PHP5 is called PHPUnit2. PHPUnit is a package for PHP4, which will be mentioned later in the chapter "using PHPUnit in PHP4.

Only install PHPUnit. the source code of PHPUnit can be found in the local PEAR Directory. The path is usually/usr/lib/php/PHPUnit2.

Although using the PEAR installer is the only installation method supported by PHPUnit, you can still install it manually. To install it manually, follow these steps:

1. Slave.

2. prepare the phpunit script

A. rename the pear-phpunit script to phpunit.

B. rename all @ php_bin @ In the script to the directory where the PHP command line interpreter is located (usually/usr/bin/php ).

C. copy the script to the directory contained in a PATH environment variable and change the file attribute to executable (chmod + x phpunit ).

3. replace all @ package_version @ strings in the PHPUnit2/Runner/Version. php script with your installed PHPUnit Version (for example, 2.3.0 ).

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.