Calling console command action does not work


I am trying to call a console action as described in the Yii guide - with Yii 1.1.8.

class ImportLegacyDBCommand extends CConsoleCommand {

	public function actionTest() {

		echo "test called";



	public function run($args) {

		echo "run called";	



In the console (from protected folder of my application): "yiic importlegacydb test"

Expected: "test called"

But the result is: "run called"

Any ideas?

Thanks, Sebastian

This should work

public function run($args)


  echo "run called";





yes If you not call the parent, no action will be called!

Thanks guys, that was a stupid miss.

Sorry I do not have enough karma to add comment to Console Commands.

Could you please leave a comment that for calling actions it requires to use parent::run() in the $this->run method.


public function run($args) {


        return 0;