How to install an older version of PHPUnit via PEAR?

I would like to downgrade my installation of PHPUnit 3.4 to 3.3. I just don't know how to do this.

How to install version 3.3 of PHPUnit on Ubuntu using PEAR?

+42
php phpunit pear
Oct. 14 '09 at 21:08
source share
5 answers

You need to know the exact version number that you want to upgrade to. At the time of writing, the latest version you are using is 3.3.17, which can be found by checking the corresponding PEAR channel.

To migrate to this particular version, run two commands:

  • pear uninstall phpunit/PHPUnit
  • pear install phpunit/PHPUnit-3.3.17
+51
Oct 21 '09 at 5:26
source share

Note that if you want to upgrade from version 3.6.x to version 3.5.15 (final version version 3.x), you need to uninstall and then reinstall several dependencies manually. Otherwise, the pear will simply force you to install the latest version of PHPUnit.

Here's how:

(The original instructions from the Dusty Reagan blog: http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/ . Are duplicated on SO, if for some reason the original link dies.)

First you need to remove PHPUnit 3.6 and all its dependencies.

 sudo pear uninstall phpunit/PHPUnit sudo pear uninstall phpunit/DbUnit sudo pear uninstall phpunit/PHP_CodeCoverage sudo pear uninstall phpunit/File_Iterator sudo pear uninstall phpunit/PHPUnit_MockObject sudo pear uninstall phpunit/Text_Template sudo pear uninstall phpunit/PHP_Timer sudo pear uninstall phpunit/PHPUnit_Selenium sudo pear uninstall pear.symfony-project.com/YAML 

Then install these specific versions of each dependency in that order by installing the latest version of PHPUnit-3.5.15.

 sudo pear install pear.symfony-project.com/YAML-1.0.2 sudo pear install phpunit/PHPUnit_Selenium-1.0.1 sudo pear install phpunit/Text_Template-1.0.0 sudo pear install phpunit/PHPUnit_MockObject-1.0.3 sudo pear install phpunit/PHP_Timer-1.0.0 sudo pear install phpunit/File_Iterator-1.2.3 sudo pear install phpunit/PHP_CodeCoverage-1.0.2 sudo pear install phpunit/DbUnit-1.0.0 sudo pear install phpunit/PHPUnit-3.5.15 

Note. You may need to add a channel for PHP_CodeCoverage, which seems to be optional for PHPUnit 3.6

 sudo pear channel-discover components.ez.no sudo pear install channel://components.ez.no/ConsoleTools-1.6 
+22
Nov 23 2018-11-21T00:
source share

If you get the Fatal error: Class 'PHP_Token_Stream' not found in /usr/share/pear/PHP/Token/Stream/CachingFactory.php on line 68 error message, you will need to use the following order to get the correct version of PHP_TokenStream:

 pear uninstall phpunit/PHPUnit pear uninstall phpunit/DbUnit pear uninstall phpunit/PHP_CodeCoverage pear uninstall phpunit/PHP_TokenStream pear uninstall phpunit/File_Iterator pear uninstall phpunit/PHP_Timer pear uninstall phpunit/PHPUnit_MockObject pear uninstall phpunit/Text_Template pear uninstall phpunit/PHPUnit_Selenium pear uninstall pear.symfony-project.com/YAML pear install pear.symfony-project.com/YAML-1.0.2 pear install phpunit/PHPUnit_Selenium-1.0.1 pear install phpunit/Text_Template-1.0.0 pear install phpunit/PHPUnit_MockObject-1.0.3 pear install phpunit/PHP_Timer-1.0.0 pear install phpunit/File_Iterator-1.2.3 pear install phpunit/PHP_TokenStream-1.0.1 pear install phpunit/PHP_CodeCoverage-1.0.2 pear install phpunit/DbUnit-1.0.0 pear install phpunit/PHPUnit-3.5.15 
+6
Dec 08 2018-11-12T00:
source share

I do not know if it is always possible to use only PEAR.

When I had to refuse the package earlier, the old version was no longer available in the channel. I uninstalled the package that I wanted to downgrade, downloaded the old version and installed from the downloaded file.

+1
Oct 16 '09 at 5:44
source share

As for downgrading from 3.6.x to 3.5.15, it works fine for me in the following order:

Removal 3.6

 sudo pear uninstall phpunit/PHPUnit_Selenium sudo pear uninstall phpunit/PHPUnit sudo pear uninstall phpunit/DbUnit sudo pear uninstall phpunit/PHP_CodeCoverage sudo pear uninstall phpunit/PHP_Iterator sudo pear uninstall phpunit/PHPUnit_MockObject sudo pear uninstall phpunit/Text_Template sudo pear uninstall phpunit/PHP_Timer sudo pear uninstall phpunit/File_Iterator sudo pear uninstall pear.symfony-project.com/YAML 

Installation 3.5.15

 sudo pear install pear.symfony-project.com/YAML-1.0.2 sudo pear install phpunit/PHPUnit_Selenium-1.0.1 sudo pear install phpunit/PHP_Timer-1.0.0 sudo pear install phpunit/Text_Template-1.0.0 sudo pear install phpunit/PHPUnit_MockObject-1.0.3 sudo pear install phpunit/File_Iterator-1.2.3 sudo pear install phpunit/PHP_CodeCoverage-1.0.2 sudo pear install phpunit/DbUnit-1.0.0 sudo pear install phpunit/PHPUnit-3.5.15 

I found a solution HERE .

0
Apr 04 2018-12-12T00:
source share



All Articles