They offer different flash templates with latest features.

Forgot password
Written by:
Score: 2
votes: 10
Format: Article

 Installing PHPUnit Test

20110921 -- I have included the date in case you are reading this years later and this don't apply anymore :).

I am creating this as a mini-log that I hope to serve as a personal experience reminder and a share with others who might experience the same issue.

OS: Linux Mint 11 64bit

Pre-requisite: It is assumed that PEAR is already installed on your system. Perform Step (i) below to check.

Steps: Open a Terminal Shell and type:

i) pear

ii) sudo pear channel-discover

iii) sudo pear channel-discover

iv) sudo pear channel-discover

v) sudo pear install phpunit/PHPUnit

The above outlined the normal procedural steps necessary to get PHPUnit installed on your system.

To check your PHPUnit installation type:

vi) phpunit

If installation is successful, you will see:

PHPUnit 3.5.15 by Sebastian Bergmann.

Usage: phpunit [switches] UnitTest [UnitTest.php]
       phpunit [switches]
.......... follow by a listing of options and what they do .......

However, if you see this error:

PHP Warning:  require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
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 38

It could mean that you might need to upgrade your version of PEAR before PHPUnit can be properly installed. Most probably, you have earlier encountered some error while installing PHPUnit using the above procedures.

If you saw the following error earlier in step (v):

a) phpunit/PHPUnit requires PEAR Installer (version >= 1.9.3), installed version is 1.9.1
b) phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
c) phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
d) phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
e) phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.2.2)

Perform the following to upgrade PEAR and re-install PHPUnit

i) sudo pear update-channels

ii) sudo pear upgrade-all

Note: My PEAR 1.9.1 was upgraded to 1.9.4; your version might be different.

iii) sudo pear install phpunit/PHPUnit

When the installation ends successfully, you will see the following at the end of the report:

install ok: channel://
install ok: channel://
install ok: channel://
install ok: channel://
install ok: channel://
install ok: channel://
install ok: channel://

To test your PHPUnit Test installation:

iv) phpunit

That's all folks, hope it helps


Tags: PHPUnit
Created: 7 years ago.
Last edited: 7 years ago.
Reviewed: 7 years ago.

6 years ago

Thank you so much for this, been battling with this problem for sometime now  
7 years ago

Thanks for the comments and encouragement.
@Alexio: Thanks for the Video link. I am also thinking of making some video tutorial. Is that an official linuxmint website or is there another?
7 years ago

PHPUnit is a very useful testing framework. Nice tutorial.  
7 years ago

This tutorial is useful after you learn How to install Apache and PEAR on Linux Mint - a video tutorial available on the Linux Mint Community Videos website.  
7 years ago

Score: 0
votes: 6
Format: Article
Created: 3 days ago.
Last edited: 3 days ago.
Reviewed: 3 days ago by oscar799.

Fix the Read 0 times.

Other tutorials from guruwannabe