protected function _getEmoticonImg($emoticonCode, $height = null) { $emoticon = CM_Emoticon::findByCode($emoticonCode); if (!$emoticon) { throw new CM_Exception_Invalid('Cannot find emoticon for code `' . $emoticonCode . '`.'); } $urlCdn = $this->_mockSite->getUrlCdn(); $siteType = $this->_mockSite->getId(); $deployVersion = CM_App::getInstance()->getDeployVersion(); $heightAttribute = $height ? ' height="' . $height . '"' : ''; return '<img src="' . $urlCdn . '/layout/' . $siteType . '/' . $deployVersion . '/img/emoticon/' . $emoticon->getFileName() . '" class="emoticon emoticon-' . $emoticon->getName() . '" title="' . $emoticon->getDefaultCode() . '"' . $heightAttribute . ' />'; }
public function __construct() { $source = new CM_PagingSource_Array(CM_Emoticon::getEmoticonData()); parent::__construct($source); }
public function testIsMail() { $emoticon = CM_Emoticon::findByCode(':-)'); $siteDefault = CM_Site_Abstract::factory(); $this->_assertSame('<span class="usertext oneline">foo <img src="http://cdn.default.dev/layout/' . $siteDefault->getId() . '/' . CM_App::getInstance()->getDeployVersion() . '/img/emoticon/smiley.png" class="emoticon emoticon-' . $emoticon->getName() . '" title=":smiley:" height="16" /></span>', array('text' => 'foo :-)', 'mode' => 'oneline', 'isMail' => true)); }
public function testFilesystemScanning() { $emoticon1 = new CM_Emoticon('smiley'); $emoticon2 = CM_Emoticon::findByCode(':)'); $this->assertEquals($emoticon1, $emoticon2); }