Calling console command action does not work

Hi!

I am trying to call a console action as described in the Yii guide http://www.yiiframework.com/doc/guide/1.1/en/topics.console#console-command-action - 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";

  parent::run();

}



(untested)

/Tommy

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) {

        parent::run($args);

        return 0;

}