Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to install latest phpUnit in Ubuntu 10.04

I'm trying to install PHPUnit in Ubuntu 10.04 but I get these error messages

sudo pear install -a pear.phpunit.de/PHPUnit
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.3 found
Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.2 found
install failed

I tried reinstalling PEAR, upgrading it; updated the PEAR and PHPUnit channel; cleared the PEAR's cache but still no luck, I keep getting the same error.

Does anyone have the same problem and know how to solve it?

Thank you.

like image 882
Dex Barrett Avatar asked Oct 23 '12 04:10

Dex Barrett


3 Answers

Yep, pointed out by Dex, but thought I'd put it up as an answer as well.

not sure why you need sudo though (taken parts from edorian's answer), this is what I did.

pear clear-cache
pear install phpunit/File_Iterator
pear install phpunit/Text_Template
pear install --force --alldeps pear.phpunit.de/PHPUnit

basically, file iterator and text template were the two I was getting duplicates on, so those are the one's I had to install individually so it wouldn't fail on those when doing the phpunit install.

like image 72
Jayson Avatar answered Sep 21 '22 19:09

Jayson


I also had this problem because the server at work is still on PHP 5.2, and installing PHPUnit directly from PEAR was picking the wrong versions of some packages, which are incompatible with PHP 5.2.

In order to fix the installation:

1) I first uninstalled all packages from channel phpunit.

2) Next I installed the right versions of the conflicting packages:

pear install pear.phpunit.de/File_Iterator-1.3.2
pear install pear.phpunit.de/Text_Template-1.1.2
pear install pear.phpunit.de/PHP_Timer-1.0.2

3) Next I could install phpunit:

[root@DanielGarcia ~]# pear install pear.phpunit.de/phpunit
Did not download optional dependencies: pear.phpunit.de/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "pear.phpunit.de/PHP_Invoker" (version >= 1.1.0)
downloading PHPUnit-3.6.12.tgz ...
Starting to download PHPUnit-3.6.12.tgz (120,240 bytes)
..........................done: 120,240 bytes
downloading PHP_CodeCoverage-1.1.4.tgz ...
Starting to download PHP_CodeCoverage-1.1.4.tgz (132,781 bytes)
...done: 132,781 bytes
downloading PHPUnit_MockObject-1.1.1.tgz ...
Starting to download PHPUnit_MockObject-1.1.1.tgz (19,910 bytes)
...done: 19,910 bytes
downloading PHP_TokenStream-1.1.4.tgz ...
Starting to download PHP_TokenStream-1.1.4.tgz (9,877 bytes)
...done: 9,877 bytes
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.1
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.4
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.4
install ok: channel://pear.phpunit.de/PHPUnit-3.6.12**
like image 43
Dani García Avatar answered Sep 20 '22 19:09

Dani García


I was facing the same problem with Ubuntu-10.04. The PHPUnit version which is compatible with PHP 5.3.2 is 3.6. This is what is creating the problem. I fixed it by installing exact versions of all the dependencies. Following are the packages which we need:

  • PHPUnit
  • File_Iterator-1.3.2
  • PHP_Timer-1.0.3
  • PHP_TokenStream-1.1.4
  • PHPUnit_MockObject-1.1.1
  • Text_Template-1.1.2
  • PHP_CodeCoverage

Detailed instructions are here

like image 42
Ashwini Dhekane Avatar answered Sep 24 '22 19:09

Ashwini Dhekane