/**
  * Sets up a view with context for testing
  *
  * @return void
  */
 public function setUpMockView()
 {
     $this->mockContext = $this->getMockBuilder(ContentContext::class)->disableOriginalConstructor()->getMock();
     $mockNode = $this->getMockBuilder(NodeData::class)->disableOriginalConstructor()->getMock();
     $this->mockContextualizedNode = $this->getMockBuilder(Node::class)->setMethods(array('getContext'))->setConstructorArgs(array($mockNode, $this->mockContext))->getMock();
     $mockSiteNode = $this->createMock(NodeInterface::class);
     $this->mockContext->expects($this->any())->method('getCurrentSiteNode')->will($this->returnValue($mockSiteNode));
     $this->mockContext->expects($this->any())->method('getDimensions')->will($this->returnValue(array()));
     $this->mockContextualizedNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext));
     $this->mockRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock();
     $mockControllerContext = $this->getMockBuilder(ControllerContext::class)->disableOriginalConstructor()->getMock();
     $this->mockSecurityContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
     $mockTypoScriptService = $this->createMock(TypoScriptService::class);
     $mockTypoScriptService->expects($this->any())->method('createRuntime')->will($this->returnValue($this->mockRuntime));
     $this->mockView = $this->getAccessibleMock(TypoScriptView::class, array('getClosestDocumentNode'));
     $this->mockView->expects($this->any())->method('getClosestDocumentNode')->will($this->returnValue($this->mockContextualizedNode));
     $this->inject($this->mockView, 'controllerContext', $mockControllerContext);
     $this->inject($this->mockView, 'securityContext', $this->mockSecurityContext);
     $this->inject($this->mockView, 'typoScriptService', $mockTypoScriptService);
     $this->mockView->_set('variables', array('value' => $this->mockContextualizedNode));
 }
 /**
  * Sets up a view with context for testing
  *
  * @return void
  */
 public function setUpMockView()
 {
     $this->mockContext = $this->getMock('TYPO3\\Neos\\Domain\\Service\\ContentContext', array(), array(), '', FALSE);
     $mockNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeData', array(), array(), '', FALSE);
     $this->mockContextualizedNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Node', NULL, array($mockNode, $this->mockContext));
     $mockSiteNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface');
     $this->mockContext->expects($this->any())->method('getCurrentSiteNode')->will($this->returnValue($mockSiteNode));
     $this->mockContext->expects($this->any())->method('getDimensions')->will($this->returnValue(array()));
     $this->mockContextualizedNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext));
     $this->mockRuntime = $this->getMock('TYPO3\\TypoScript\\Core\\Runtime', array(), array(), '', FALSE);
     $mockControllerContext = $this->getMock('TYPO3\\Flow\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
     $this->mockSecurityContext = $this->getMock('TYPO3\\Flow\\Security\\Context', array(), array(), '', FALSE);
     $mockTypoScriptService = $this->getMock('TYPO3\\Neos\\Domain\\Service\\TypoScriptService');
     $mockTypoScriptService->expects($this->any())->method('createRuntime')->will($this->returnValue($this->mockRuntime));
     $this->mockView = $this->getAccessibleMock('TYPO3\\Neos\\View\\TypoScriptView', array('getClosestDocumentNode'));
     $this->mockView->expects($this->any())->method('getClosestDocumentNode')->will($this->returnValue($this->mockContextualizedNode));
     $this->inject($this->mockView, 'controllerContext', $mockControllerContext);
     $this->inject($this->mockView, 'securityContext', $this->mockSecurityContext);
     $this->inject($this->mockView, 'typoScriptService', $mockTypoScriptService);
     $this->mockView->_set('variables', array('value' => $this->mockContextualizedNode));
 }