Yii Framework Forum: Console, Themes and unit testing. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Console, Themes and unit testing. Rate Topic: -----

#1 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 386
  • Joined: 08-June 10
  • Location:France (Ile-de-France/Val d'Oise)

Posted 10 December 2014 - 07:40 PM

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?).
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users