/**
  * @test
  */
 public function renderCallsStandardWrapOnResultStringIfGivenInConfiguration()
 {
     $this->addMockViewToSubject();
     $configuration = array('stdWrap.' => array('foo' => 'bar'));
     $this->standaloneView->expects($this->any())->method('render')->will($this->returnValue('baz'));
     $this->contentObjectRenderer->expects($this->once())->method('stdWrap')->with('baz', array('foo' => 'bar'));
     $this->subject->render($configuration);
 }
Esempio n. 2
0
 /**
  * Assign content object renderer data and current to view, called by TYPO3 6.2
  *
  * @param array $conf Configuration
  * @author Benjamin Butschell <*****@*****.**>
  * @return void
  */
 protected function assignContentObjectDataAndCurrent(array $conf = array())
 {
     // Call Parent Function to maintain core functions
     parent::assignContentObjectDataAndCurrent($conf);
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->utility = $this->objectManager->get("MASK\\Mask\\Utility\\MaskUtility");
     // Make some enhancements to data
     $data = $this->cObj->data;
     $this->utility->addFilesToData($data, "pages");
     $this->utility->addIrreToData($data, "pages");
     $this->view->assign('data', $data);
 }
 /**
  * Set template
  *
  * @param array $conf With possibly set file resource
  * @return void
  * @throws \InvalidArgumentException
  */
 protected function setTemplate(array $conf)
 {
     // Fetch the Fluid template by templateName
     if (!empty($conf['templateName']) && !empty($conf['templateRootPaths.']) && is_array($conf['templateRootPaths.'])) {
         $templateRootPaths = $this->applyStandardWrapToFluidPaths($conf['templateRootPaths.']);
         $this->view->setTemplateRootPaths($templateRootPaths);
         $templateName = isset($conf['templateName.']) ? $this->cObj->stdWrap($conf['templateName'], $conf['templateName.']) : $conf['templateName'];
         $this->view->setTemplate($templateName);
         // Fetch the Fluid template by template cObject or file stdWrap
     } else {
         parent::setTemplate($conf);
     }
 }