/** * @test */ public function renderAddsPlaceholder() { $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('addAttribute', 'setContent', 'render'), array(), '', false); $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('placeholder', 'SomePlaceholder'); $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('name', 'NameOfTextarea'); $mockTagBuilder->expects($this->once())->method('render'); $this->viewHelper->_set('tag', $mockTagBuilder); $arguments = array('name' => 'NameOfTextarea', 'placeholder' => 'SomePlaceholder'); $this->viewHelper->setArguments($arguments); $this->viewHelper->setViewHelperNode(new \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\EmptySyntaxTreeNode()); $this->viewHelper->initialize(); $this->viewHelper->render(); }
/** * * Renders the editor. This method first adds some javascript inclusions to the * page header, then renders the options panel and finally renders the main * textarea using the inherited render() method. * * @return string HTML content * */ public function render() { $this->initializeJavascriptSetupFromConfiguration($this->arguments['configuration']); return $this->javascriptSetup . parent::render(); }