Phpunit Error : No Available Commands

I used PEAR to install PHPUnit and had no problems. I’m on a Mac. I used PHPUnit for months without error. Now I haven’t used it in a several months, and I ran the same command I ran months ago, but now I get an error. E.g.


$ /opt/local/bin/PHPUnit ActivityUtilTest

No available commands.

Please define them under the following directory:


// -----------------------------

// HERE's the file ActivityUtilTest.php :

// -----------------------------


require_once('bootstrap.php');


class ActivityUtilTest extends PHPUnit_Framework_TestCase {

    public function test01() {

             $this->assertEquals(1, 1);

   }

}


// -----------------------------

// HERE's the file bootstrap.php

// -----------------------------

$yii=dirname(__FILE__).'/../_shared/yii/framework/yii.php';

$config=dirname(__FILE__).'/../_config/CONFIG.php';

require_once($yii);

Yii::createConsoleApplication($config)->run();



I’m running the latest Yii code, version 1.1.12

Any help appreciated, thank you.

"No available commands" is something that CHelpCommand would write to the console if invoked with no commands set in place. Can you check if the command runner is invoked somewhere in your test suite?

Not sure if it’s related, but there were some issues with Yii and PHPUnit 3.7+. Have you updated PHPUnit recently?

I am definitely using the most recent PHP Unit - version 3.7.10, and would really prefer NOT to downgrade PHPUnit.

By switching to an older version of Yii (1.1.10), the unit test will now run, but it does give an ugly warning first about no available commands. (And yes, I tried the hack of creating some empty commands in the directory protected/commands. That still causes the warning to be spewed.)

Here’s the latest output, which I get again by reverting to Yii 1.1.10:




phpunit --configuration phpunit.xml ActivityUtilTest

No available commands.

Please define them under the following directory:

	

PHPUnit 3.7.10 by Sebastian Bergmann.


Configuration read from ~/Sites/bb/protected/tests/unit/phpunit.xml


.

ActivityUtilTest::testFetchAssignmentByPk 


Time: 0 seconds, Memory: 10.00Mb


OK (1 test, 1 assertion)



I would much prefer to be using the latest Yii. Ideas anyone?