How to install an older version of PHPUnit through PEAR?

前端 未结 5 1671
栀梦
栀梦 2020-12-01 02:36

I would like to downgrade my installation of PHPUnit 3.4 to 3.3. I\'m just not sure how to do it.

How do I install version 3.3 of PHPUnit on Ubuntu using PEAR?

5条回答
  •  Happy的楠姐
    2020-12-01 03:18

    Note that if you wish to downgrade from a 3.6.x release to 3.5.15 (final stable 3.x release), then you need to uninstall, then reinstall several dependencies manually. Otherwise pear will just force install the latest version of PHPUnit.

    Here's how:

    (Original instructions from Dusty Reagan's blog: http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/. duplicated to SO in case original link dies for some reason.)

    First you need to uninstall PHPUnit 3.6 and all of it’s 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
    

    Next install these specific versions of each dependency, in this order, installing PHPUnit-3.5.15 last.

    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 channel for PHP_CodeCoverage, which doesn't seem to be obligatory for PHPUnit 3.6

    sudo pear channel-discover components.ez.no
    sudo pear install channel://components.ez.no/ConsoleTools-1.6
    

提交回复
热议问题