0 votes
1 view
in Devops and Agile by (16.4k points)

I installed PHPUnit using the PEAR installer a few days ago (I also installed Selenium RC for testing in PHP purpose). Now I want to uninstall it (also delete all related folders and files)

I ran the following command:

pear uninstall phpunit/PHPUnit

and the console displayed:

phpunit/PHPUnit not installed

I checked the PHPUnit folder, it was still there?

Was it uninstalled? I try to reinstall a new PHPUnit, but the console displayed:

No releases available for package "pear.phpunit.de/PHPUnit"

How can I reinstall it?


Here's the output of pear list -c pear.phpunit.de:

pear list -c pear.phpunit.de

Here's output of pear list -c pear.phpunit.de:

pear list -c pear.phpunit.de

1 Answer

0 votes
by (45.5k points)

That might be because of sub-components (Extensions, Framework) incompatibility. However, you must not be concerned about that.

To install the latest version, do the following two commands:

> pear config-set auto_discover 1

config-set succeeded

> pear upgrade

...

This will take a while, and will update all that is presently installed.

As you have some extensions already offered and the latest version of PHPUnit would possibly need those, so update them to prevent failure in the next command:

> pear install pear.phpunit.de/PHPUnit

This should now install it:

Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically

 

phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.0.0)

downloading PHPUnit-3.6.7.tgz ...

Starting to download PHPUnit-3.6.7.tgz (118,349 bytes)

..........................done: 118,349 bytes

install ok: channel://pear.phpunit.de/PHPUnit-3.6.7

Troubleshooting PEAR

As you reported in comments, this did not work out.

Probably pear is in a state that it doesn't understand where top and bottom is.

Time to force. First, clear the cache:

> pear clear-cache

reading directory C:\...\Tmp\pear\cache

0 cache entries cleared

Then force channel updates:

> pear channel-update -f pear.php.net

Updating channel "pear.php.net"

Update of Channel "pear.php.net" succeeded

> pear channel-update -f pear.phpunit.de

Updating channel "pear.phpunit.de"

Update of Channel "pear.phpunit.de" succeeded

Then force the PHPUnit install:

> pear install -a -f phpunit/PHPUnit

...