/** * Constructor. * * @param \TYPO3\TypoScript\TypoScriptObjects\TemplateImplementation $templateImplementation * @param string $path * @param array $partialTypoScriptTree */ public function __construct(\TYPO3\TypoScript\TypoScriptObjects\TemplateImplementation $templateImplementation, $path, array $partialTypoScriptTree) { $this->templateImplementation = $templateImplementation; $this->tsRuntime = $templateImplementation->getTsRuntime(); $this->path = $path; $this->partialTypoScriptTree = $partialTypoScriptTree; }
public function setUp() { parent::setUp(); $this->editableViewHelper = $this->getAccessibleMock('TYPO3\\Neos\\ViewHelpers\\ContentElement\\EditableViewHelper', array('renderChildren')); $this->mockPrivilegeManager = $this->getMockBuilder('TYPO3\\Flow\\Security\\Authorization\\PrivilegeManagerInterface')->getMock(); $this->inject($this->editableViewHelper, 'privilegeManager', $this->mockPrivilegeManager); $this->mockNodeAuthorizationService = $this->getMockBuilder(AuthorizationService::class)->getMock(); $this->inject($this->editableViewHelper, 'nodeAuthorizationService', $this->mockNodeAuthorizationService); $this->mockTemplateImplementation = $this->getMockBuilder('TYPO3\\TypoScript\\TypoScriptObjects\\TemplateImplementation')->disableOriginalConstructor()->getMock(); $this->mockTsRuntime = $this->getMockBuilder('TYPO3\\TypoScript\\Core\\Runtime')->disableOriginalConstructor()->getMock(); $this->mockContentContext = $this->getMockBuilder('TYPO3\\Neos\\Domain\\Service\\ContentContext')->disableOriginalConstructor()->getMock(); $this->mockNode = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface')->getMock(); $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContentContext)); $this->mockTsContext = array('node' => $this->mockNode); $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue($this->mockTsContext)); $this->mockTemplateImplementation->expects($this->any())->method('getTsRuntime')->will($this->returnValue($this->mockTsRuntime)); $this->mockView = $this->getAccessibleMock('TYPO3\\TypoScript\\TypoScriptObjects\\Helpers\\FluidView', array(), array(), '', FALSE); $this->mockView->expects($this->any())->method('getTypoScriptObject')->will($this->returnValue($this->mockTemplateImplementation)); $this->editableViewHelper->initializeArguments(); }
public function setUp() { parent::setUp(); $this->editableViewHelper = $this->getAccessibleMock(EditableViewHelper::class, array('renderChildren')); $this->mockPrivilegeManager = $this->getMockBuilder(PrivilegeManagerInterface::class)->getMock(); $this->inject($this->editableViewHelper, 'privilegeManager', $this->mockPrivilegeManager); $this->mockNodeAuthorizationService = $this->getMockBuilder(AuthorizationService::class)->getMock(); $this->inject($this->editableViewHelper, 'nodeAuthorizationService', $this->mockNodeAuthorizationService); $this->mockContentElementEditableService = $this->getMockBuilder(ContentElementEditableService::class)->getMock(); $this->inject($this->editableViewHelper, 'contentElementEditableService', $this->mockContentElementEditableService); $this->mockTemplateImplementation = $this->getMockBuilder(TemplateImplementation::class)->disableOriginalConstructor()->getMock(); $this->mockTsRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock(); $this->mockContentContext = $this->getMockBuilder(ContentContext::class)->disableOriginalConstructor()->getMock(); $this->mockNode = $this->getMockBuilder(NodeInterface::class)->getMock(); $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContentContext)); $this->mockNode->expects($this->any())->method('getNodeType')->will($this->returnValue(new NodeType('Acme.Test:Headline', [], []))); $this->mockTsContext = array('node' => $this->mockNode); $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue($this->mockTsContext)); $this->mockTemplateImplementation->expects($this->any())->method('getTsRuntime')->will($this->returnValue($this->mockTsRuntime)); $this->mockView = $this->getAccessibleMock(FluidView::class, array(), array(), '', false); $this->mockView->expects($this->any())->method('getTypoScriptObject')->will($this->returnValue($this->mockTemplateImplementation)); $this->editableViewHelper->initializeArguments(); }
/** * {@inheritdoc} * * @return string */ public function evaluate() { $this['items'] = $this->getItems(); return parent::evaluate(); }
/** * * @return type */ public function evaluate() { $context = $this->getTsRuntime()->getCurrentContext(); $this->formRegistry->setFormNode($this->getFormIdentifier(), $context['node']); return parent::evaluate(); }