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
Differencebetween Null and Empty
Connection Reset by Peer: Mod_Fcgid: Error Reading Data from Fastcgi Server
Difference Between File, File_Get_Contents, and Fopen in PHP
Creating an Image Without Storing It as a Local File
Sending Correct File Size with PHP Download Script
Replace Ereg_Replace with Preg_Replace
Mailgun Sent Mail with Attachment
Code to Parse User Agent String
Can Anyone Get Access to My PHP Source Code
Adding Multiple Items to Woocommerce Cart at Once
Openssl Not Working on Windows, Errors 0X02001003 0X2006D080 0X0E064002
Get All Defined Classes of a Parent Class in PHP
Create New Product Attribute Programmatically in Woocommerce
Add a Quantity Field to Ajax Add to Cart Button on Woocommerce Shop Page