Phpunit pocket guide-Chapter 4 phpunit Installation

Source: Internet
Author: User

The4Chapter InstallPhpunit

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 @ In the phpunit2/runner/version. php script @Replace the string with the phpunit version you have installed (for example, 2.3.0 ).

 

Bytes --------------------------------------------------------------------------------------------------------------------

Original

Chapter 4. Installing phpunit

Phpunit [1] is available from the PHP extension and application repository (PEAR), [2] Which is a framework and Distribution System for reusable PHP components. it can be installed using the pear Installer:

 

[1] http://www.phpunit.de/

 

[2] http://pear.php.net/

 

$ Pear install phpunit2

 

 

 

Due to pear's version-Naming Standard, the phpunit package for PHP 5 is called phpunit2. phpunit is the name of the phpunit package for PHP 4 that is the topic of "phpunit for PHP 4," Later in this book.

 

After the installation, you can find the phpunit source files inside your local pear directory; the path is usually/usr/lib/PHP/phpunit2.

 

Although using the pear installer is the only supported way to install phpunit, you can install phpunit manually. For manual installation, do the following:

 

Download a release archive from http://pear.php.net/package/PHPUnit2/download and extract it to a directory that is listed in the include_path of your php. ini configuration file.

 

Prepare the phpunit script:

 

Rename the pear-phpunit script to phpunit.

 

Replace the @ php_bin @ string in it with the path to your PHP command-line interpreter (usually/usr/bin/PHP ).

 

Copy it to a directory that is in your path and make it executable (chmod + x phpunit ).

 

Replace the @ package_version @ string in the phpunit2/runner/version. php script with the version number of the phpunit release you are installing (2.3.0, for instance ).

 

 

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.