Upgrade PEAR itself:
$ pear install PEAR
Do not use pear upgrade
. For me, this installed a version of pear.symfony-project.com/YAML
that is incompatible with PHPUnit 3.6.
Install PHPUnit
$ pear config-set auto_discover 1
$ pear install pear.phpunit.de/PHPUnit
Create a very simple test:
<?php
class FooTest extends PHPUnit_Framework_TestCase
{
public function testBar()
{
$this->assertEmpty('foo');
}
}
?>
Run it: phpunit FooTest.php
The run should fail with this message:
1) FooTest::testBar
Failed asserting that a string is empty.
This could happen if something else that you have installed needs pear.symfony-project.com/YAML
in a version other than 1.0.2 (that is the version that PHPUnit 3.6.12 needs).
I think your best bet would be to create a separate PHP installation with php-build and switch between the two using phpenv.