How to Install an Older Version of PHPunit Through Pear

How to install an older version of PHPUnit through PEAR?

You need to know the exact version number you wish to downgrade to. At the time of writing, the last release you're after is 3.3.17, which can be found out by checking the appropriate PEAR channel.

To downgrade to that particular version execute two commands:

  • pear uninstall phpunit/PHPUnit
  • pear install phpunit/PHPUnit-3.3.17

Installing PHPUnit via PEAR

I had the same problem yesterday, and solved it by updating the channels

pear clear-cache
pear update-channels

before trying to install phpUnit.

Hope this helps.

installing phpunit/PHPUnit-3.5.5 via pear (for sonar)

To get this from the unanswered questions page: See How to install an older version of PHPUnit through PEAR? for an exact answer to your problem.

How do I correctly install PHPUnit with PEAR?

I had the same problem while upgrading my phpunit.

This solved the problem:

pear channel-discover pear.symfony.com
pear install pear.symfony.com/Yaml

Then run:

pear install --alldeps pear.phpunit.de/PHPUnit

OBS: I think the pear install pear.symfony.com/Yaml is not necessary. I'm just posting it because it is exactly the way I solved my problem.

How to Downgrade PHPUnit 3.7.21 to 3.5.15

pear uninstall phpunit/PHPUnit
pear uninstall phpunit/DbUnit
pear uninstall phpunit/PHP_CodeCoverage
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 uninstall phpunit/PHP_TokenStream

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

How do I run multiple versions of PHPUnit on the same machine?

I'd recommend you check this blog post:

  • http://tech.vg.no/2011/11/29/running-multiple-versions-of-phpunit/

For a chef-recipe, check my blog post:

  • http://till.klampaeckel.de/blog/archives/175-Cooking-PHPUnit-and-a-chef-solo-example-on-top.html

In case the links stop working:

  • pear supports an --installroot switch
  • example:

    pear install --installroot /some/path/phpunit34 pear.phpunit.de/PHPUnit-3.4.15

Once install, you may have to add /some/path/phpunit34/usr/bin/ to $PATH or create a symlink to /usr/bin like the blog post illustrates.

HTH

Can't install PHPUnit with PEAR 1.9.1

An older version of PEAR was at c:\PHP, which was referenced in the PATH. PEAR saw this version first and ignored the newer one. The reference to the folder with the older version has to be removed from the PATH variable before installing PHPUnit.
I thank David Harkness for the clue.

Troubles with installation of PHPUnit 4.0 through PEAR - no PHPUnit folder in include path

Okay,

I will answer this question my own, since I now know my mistake in the try to install the old PHPUnit version by PEAR.

The Command for installing the old version 3.7.37, which I have at the old virtual machine, is

sudo pear install --force --alldeps phpunit/PHPUnit-3.7.27

Since this is the worst possible solution I have it would be nice to receive additional answers. By the end of this day I gonna accept the best.

PHPUnit - Version 3.7.21 instead of Version 6 installed

You run your global PHPUnit version which is installed in another folder. To get the installed version you have to go to the vendor/bin folder.

vendor/bin/phpunit --version
PHPUnit 6.0.8 by Sebastian Bergmann and contributors.

In newer versions you can run it with bin/phpunit there should be the executable. When you need another PHP-Version then define it before php74 bin/phpunit.



Related Topics



Leave a reply



Submit