/** * Render the icon as HTML code * * @param string $alternativeMarkupIdentifier * * @return string */ public function render($alternativeMarkupIdentifier = null) { $overlayIconMarkup = ''; if ($this->overlayIcon !== null) { $overlayIconMarkup = '<span class="icon-overlay icon-' . htmlspecialchars($this->overlayIcon->getIdentifier()) . '">' . $this->overlayIcon->getMarkup() . '</span>'; } return str_replace('{overlayMarkup}', $overlayIconMarkup, $this->wrappedIcon($alternativeMarkupIdentifier)); }
/** * @test */ public function getIconWithInlineOptionReturnsCleanSvgMarkup() { $this->subject->prepareIconMarkup($this->icon, array('source' => $this->testFileName)); $this->assertEquals('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#CD201F" d="M11 12l3-2v6H2v-6l3 2 3-2 3 2z"/></svg>', $this->icon->getMarkup(SvgIconProvider::MARKUP_IDENTIFIER_INLINE)); }
/** * @test */ public function prepareIconMarkupEXTSourceReferenceReturnsInstanceOfIconWithCorrectMarkup() { $this->subject->prepareIconMarkup($this->icon, array('source' => 'EXT:core/Resources/Public/Images/foo.png')); $this->assertEquals('<img src="typo3/sysext/core/Resources/Public/Images/foo.png" width="16" height="16" />', $this->icon->getMarkup()); }
/** * @test */ public function prepareIconMarkupWithNameReturnsInstanceOfIconWithCorrectMarkup() { $this->subject->prepareIconMarkup($this->icon, array('name' => 'times')); $this->assertEquals('<span class="icon-unify"><i class="fa fa-times"></i></span>', $this->icon->getMarkup()); }