Console, Themes and unit testing.

Hi

I need to access the user theme in a console (cron) execution (Yii1)

Unit testing fails because the CThemeManager uses the script location to find where the themes are, and when running phpunit, the script locaction is ‘phpunit’

In the theme manager:




	/**

	 * @return string the base path for all themes. Defaults to "WebRootPath/themes".

	 */

	public function getBasePath()

	{

		if($this->_basePath===null)

			$this->setBasePath(dirname(Yii::app()->getRequest()->getScriptFile()).DIRECTORY_SEPARATOR.self::DEFAULT_BASEPATH);

		return $this->_basePath;

	}

I’ll work arround this with an overload of the getBasePath implementation, but maybe the teams wants to implement a more generic solution for Yii1 (/2?).