Page 1 of 1

Pear-phpunit

Posted: Wed May 16, 2007 7:38 am
by kpraman
I want to install phpUnit 3. I have installed pear. When I open Web-based PEAR Frontend and searched for PHPUnit 3. It is only showing phpunit 1.3.3. Where can i get PHPUnit 3.

Posted: Wed May 16, 2007 8:59 am
by Maugrim_The_Reaper
First of all make sure you know how to use PEAR Installer from the command line. Check the PEAR site for the documentation.

Uninstall all PEAR default PHPUnit packages - then go check the PEAR directory to ensure they were all deleted. If actually require v1 or v2 obviously you need to rethink this.

Then? It's in the manual.
http://www.phpunit.de/pocket_guide/3.0/ ... ation.html

You'll have PHPUnit 3 running in no time...

Posted: Wed May 16, 2007 9:42 am
by kpraman
I installed pear through go-pear. My OS is windows. When i search for PHPUnit 3 it shows no results. but, when i click [ list available upgrades ] PHPUnit 3 is listed in the results. If i click on update, it gives the error Will upgrade channel://pear.phpunit.de/phpunit
phpunit/phpunit is already installed and is newer than detected release version 1.3.3
Cannot initialize 'channel://pear.phpunit.de/phpunit', invalid or missing package file

upgrade-all failed



Posted: Wed May 16, 2007 11:25 am
by Maugrim_The_Reaper
Uninstall all PHPUnits from your system and restart. Should work fine. Check they are all fully deleted from the /php/pear directory also.

Posted: Thu May 17, 2007 3:05 am
by kpraman
Uninstalled and reinstalled. Still i am only able to install 1.3.3 version. Is PHPUnit 1.3 + is moved out of pear? When i was searching in google, i got this info. Check this link http://marc.info/?l=pear-dev&m=115212195328840&w=2

Posted: Thu May 17, 2007 3:19 am
by Maugrim_The_Reaper
The PEAR versions are no longer sourced from PHPUnit.de - the dev team have their own PEAR channel now.

What PEAR install command are you using? Are you declaring the channel you're installing from?
pear install phpunit/PHPUnit
not
pear install PHPUnit
If it's still not working, try the manual installation instructions from the manual. Can you also check you're actually working from the correct pear/php install. I know one can be bitten if there are a few PHP installs or php.ini files sitting on your PATH.

Posted: Thu May 17, 2007 3:36 am
by kpraman
channel: pear.phpunit.de. Is this correct channel?

For manual installation,

I downloaded PHPUnit-3.0.6.tgz and extracted.

I am not able to rename the pear-phpunit to phpunit (it says allready a file has the same name. (The extracted folder has 2 folders - PHPUnit, PHPUnit2. 1 script file, pear-phpunit and pear-phpunit batch file)).

Posted: Thu May 17, 2007 6:17 am
by Maugrim_The_Reaper
I think you have artifacts of a previous installation. Things shouldn't be conflicting like this from a fresh start. I mean if a simple rename is being refused then where's the file blocking it?

What system exactly are you running? Some prebuilt packages on Windows (like XAMPP) can sometimes read-only PEAR files and scripts and prevent a wholesale delete of them. The same problem can also leave a PEAR install unfinished.

Posted: Thu May 17, 2007 6:54 am
by kpraman
I am using wamp server.

Its not allowing to rename because, the extracted folder has a folder named phpunit.

Posted: Thu May 17, 2007 7:47 am
by kpraman
I renamed it as phpunit.php. The paths of the files are as below. I am working on Windows.

.ini file has:- include_path = ".;c:\php\includes".

wamp is installed in c:\. (C:\wamp).

i placed the downloaded phpunit files in : C:\wamp\php\includes\PHPUnit-3.0.6\PHPUnit-3.0.6

Placed phpunit.php in: C:\wamp\www\phpunit\phpunit.php. In the script i replaced @ @ with #!c:\wamp\php\

In the class file, i have written

Code: Select all

require_once 'PHPUnit-3.0.6\PHPUnit-3.0.6\PHPUnit\Framework.php';
to test whether its working or not. Its not working.

It is giving,
Warning: require_once(PHPUnit-3.0.6\PHPUnit-3.0.6\PHPUnit\Framework.php) [function.require-once]: failed to open stream: No such file or directory in

Pls let me know where i made wrong.

Posted: Thu May 17, 2007 4:40 pm
by Weirdan
.ini file has:- include_path = ".;c:\php\includes".

wamp is installed in c:\. (C:\wamp).