Home Backend Development PHP Tutorial 手动装配phpunit

手动装配phpunit

Jun 13, 2016 pm 12:59 PM
git pear php phpunit share

手动安装phpunit

在ubuntu12.04下面phpunit报错

<code style="margin:0px; padding:0px; border:0px; vertical-align:baseline; font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif"><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">PHP </span><span class="typ" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(43,145,175)">Fatal</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent"> error</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">:</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">  </span><span class="typ" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(43,145,175)">Call</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent"> to </span><span class="kwd" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(0,0,139)">undefined</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent"> method PHP_CodeCoverage_Filter</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">::</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">getInstance</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">()</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent"> </span><span class="kwd" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(0,0,139)">in</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent"> </span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">/</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">usr</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">/</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">share</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">/</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">php</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">/</span><span class="typ" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(43,145,175)">PHPUnit</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">/</span><span class="typ" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(43,145,175)">Framework</span><span class="pun" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">.</span><span class="pln" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent">php on line </span><span class="lit" style="margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent; color:rgb(128,0,0)">46</span></code>
Copy after login
Copy after login

$ pear config-show
Which showed this (unlike my config-show):

Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels auto_discover 
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy 
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config 
PEAR executables directory bin_dir /usr/bin
PEAR documentation directory doc_dir /usr/share/php/doc
PHP extension directory ext_dir /usr/lib/php5/20090626+lfs
PEAR directory php_dir /usr/share/php
PEAR Installer cache directory cache_dir /tmp/pear/cache
PEAR configuration file cfg_dir /usr/share/php/cfg
directory
PEAR data directory data_dir /usr/share/php/data
PEAR Installer download download_dir /build/buildd/php5-5.3.10/pear-build-download
directory
PHP CLI/CGI binary php_bin /usr/bin/php
php.ini location php_ini 
--program-prefix passed to php_prefix 
PHP’s ./configure
--program-suffix passed to php_suffix 
PHP’s ./configure
PEAR Installer temp directory temp_dir /tmp/pear/temp
PEAR test directory test_dir /usr/share/php/test
PEAR www files directory www_dir /usr/share/php/htdocs
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 2
Debug Log Level verbose 1
PEAR password (for password maintainers)
Signature Handling Program sig_bin /usr/bin/gpg
Signature Key Directory sig_keydir /etc/pear/pearkeys
Signature Key Id sig_keyid 
Package Signature Type sig_type gpg
PEAR username (for username 
maintainers)
User Configuration File Filename /home/username/.pearrc
System Configuration File Filename /etc/pear/pear.conf
You need to set following configurations:

sudo pear config-set bin_dir /usr/bin
sudo pear config-set doc_dir /usr/share/php/doc
sudo pear config-set php_dir /usr/share/php
sudo pear config-set cfg_dir /usr/share/php/cfg (make (sudo mkdir cfg) directory here)
sudo pear config-set data_dir /usr/share/php/data
sudo pear config-set test_dir /usr/share/php/test
Copy after login


sudo apt-get install git
mkdir phpunit && cd phpunit
git clone git://github.com/sebastianbergmann/phpunit.git
git clone git://github.com/sebastianbergmann/dbunit.git
git clone git://github.com/sebastianbergmann/php-file-iterator.git
git clone git://github.com/sebastianbergmann/php-text-template.git
git clone git://github.com/sebastianbergmann/php-code-coverage.git
git clone git://github.com/sebastianbergmann/php-token-stream.git
git clone git://github.com/sebastianbergmann/php-timer.git
git clone git://github.com/sebastianbergmann/phpunit-mock-objects.git
git clone git://github.com/sebastianbergmann/phpunit-selenium.git
git clone git://github.com/sebastianbergmann/phpunit-story.git
git clone git://github.com/sebastianbergmann/php-invoker.git
sudo cp -r dbunit/PHPUnit /usr/share/php/
sudo cp -r php-code-coverage/PHP /usr/share/php/
sudo cp -r php-file-iterator/File /usr/share/php/
sudo cp -r php-invoker/PHP /usr/share/php/
sudo cp -r php-text-template/Text /usr/share/php/
sudo cp -r php-timer/PHP /usr/share/php/
sudo cp -r php-token-stream/PHP /usr/share/php/
sudo cp -r phpunit/PHPUnit /usr/share/php/
sudo cp -r phpunit-mock-objects/PHPUnit /usr/share/php/
sudo cp -r phpunit-selenium/PHPUnit /usr/share/php/
sudo cp -r phpunit-story/PHPUnit /usr/share/php/
sudo cp -r phpunit/phpunit.php /usr/share/php/
Copy after login





Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

How to run the h5 project How to run the h5 project Apr 06, 2025 pm 12:21 PM

Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

Explain the match expression (PHP 8 ) and how it differs from switch. Explain the match expression (PHP 8 ) and how it differs from switch. Apr 06, 2025 am 12:03 AM

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

Does H5 page production require continuous maintenance? Does H5 page production require continuous maintenance? Apr 05, 2025 pm 11:27 PM

The H5 page needs to be maintained continuously, because of factors such as code vulnerabilities, browser compatibility, performance optimization, security updates and user experience improvements. Effective maintenance methods include establishing a complete testing system, using version control tools, regularly monitoring page performance, collecting user feedback and formulating maintenance plans.

What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? Apr 07, 2025 am 12:02 AM

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) Apr 08, 2025 am 12:03 AM

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Apr 06, 2025 am 12:07 AM

The... (splat) operator in PHP is used to unpack function parameters and arrays, improving code simplicity and efficiency. 1) Function parameter unpacking: Pass the array element as a parameter to the function. 2) Array unpacking: Unpack an array into another array or as a function parameter.

See all articles