Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install the old version of PHPUNIT?

We have a Centos 6.3 machine running PHP 5.3.3. I accidentally uninstalled PHPUNIT. I am not able to reinstall it again. The newer versions do not work with PHP 5.3.3. Unfortunately, I cannot update my PHP version (company is stuck). How do I fix it?

I tried:

$ wget https://phar.phpunit.de/phpunit.phar
$ chmod +x phpunit.phar
$ sudo mv phpunit.phar /usr/local/bin/phpunit
$ phpunit --version

as suggested and it is not working.

like image 815
ssk Avatar asked Feb 18 '16 22:02

ssk


1 Answers

So I simply took a look at https://phar.phpunit.de and as you can see there, you can specify the version number you want to install, eg.

$ wget https://phar.phpunit.de/phpunit-4.8.9.phar

However, I'd recommend using Composer where you can specify version numbers as well (described in the doc)

{
    "require-dev": {
        "phpunit/phpunit": "4.8.*"
    }
}

Using Composer brings many advantages. One of them is that you can make sure that the same version of a library is used by everyone working on the project (without having to share all the vendor files!)

like image 112
kero Avatar answered Sep 19 '22 19:09

kero