PHPUnit Pocket Guide Installation PHPUnit

Source: Internet
Author: User
Tags command line pear php script
This phpunit can be obtained through the PHP Extensions and library (Peae). Pear is the framework and distribution system for reusable PHP components. Installation PHPUnit can be obtained by using the Pear Installer command:

Pear Install PHPUnit2

According to Pear's version naming standard, the PHPUnit package that applies to PHP5 is called PHPUnit2. PHPUnit is a package that applies to PHP4, which is mentioned in the chapter on "Using PHPUnit in PHP4" later in this book.

Install only, can find the PHPUnit source code in the local pear directory, the path is usually/usr/lib/php/phpunit2.

Although using the Pear installer is the only supported installation method for PHPUnit, you can still install it manually. To install manually, refer to the following practices:

1. Download the PHPUnit release package from the Http://pear.php.net/package/PHPUnit2/download, and then unzip it to make sure that the directory is in php.ini defined include_path.

2. Prepare PHPUnit Scripts

A. Rename the Pear-phpunit script to PHPUnit

B. Rename all @php_bin@ in the script to the directory (typically/usr/bin/php) where the PHP command line interpreter resides.

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

3. Replace all @package_version@ strings in the phpunit2/runner/version.php script with the version of PHPUnit you have installed (such as 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.