本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::setRenderingContext方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::setRenderingContext方法的具體用法?PHP AccessibleObjectInterface::setRenderingContext怎麽用?PHP AccessibleObjectInterface::setRenderingContext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::setRenderingContext方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
/**
* @throws \InvalidArgumentException
*/
protected function setUp()
{
$this->subject = $this->getAccessibleMock(TypolinkViewHelper::class, array('renderChildren'));
/** @var RenderingContext $renderingContext */
$renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
$this->subject->setRenderingContext($renderingContext);
}
示例2: setUp
/**
* @throws \InvalidArgumentException
*/
protected function setUp()
{
$this->subject = $this->getAccessibleMock(TypolinkViewHelper::class, array('renderChildren'));
/** @var RenderingContext $renderingContext */
$renderingContext = $this->getMock(RenderingContext::class);
$this->subject->setRenderingContext($renderingContext);
}
示例3: setUp
/**
* Sets up this test case
*
* @return void
*/
protected function setUp()
{
$this->singletonInstances = GeneralUtility::getSingletonInstances();
$this->view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array('testFileExistence', 'buildParserConfiguration'), array(), '', false);
$this->mockTemplateParser = $this->getMock(TemplateParser::class);
$this->mockParsedTemplate = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface::class);
$this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
$this->mockConfigurationManager = $this->getMock(ConfigurationManagerInterface::class);
$this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
$this->mockRequest = $this->getMock(Request::class);
$this->mockUriBuilder = $this->getMock(UriBuilder::class);
$this->mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
$this->mockControllerContext = $this->getMock(ControllerContext::class);
$this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest));
$this->mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
$this->mockRenderingContext = $this->getMock(RenderingContext::class);
$this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
$this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
$this->view->_set('templateParser', $this->mockTemplateParser);
$this->view->_set('objectManager', $this->mockObjectManager);
$this->view->setRenderingContext($this->mockRenderingContext);
$this->mockTemplateCompiler = $this->getMock(TemplateCompiler::class);
$this->view->_set('templateCompiler', $this->mockTemplateCompiler);
GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class, $this->mockObjectManager);
GeneralUtility::addInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, $this->mockContentObject);
$mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array(), array(), '', false);
$mockCache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, array(), array(), '', false);
$mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager);
}
示例4: setUp
/**
* Sets up this test case
*
* @return void
*/
public function setUp()
{
$this->singletonInstances = GeneralUtility::getSingletonInstances();
$this->view = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\StandaloneView', array('testFileExistence', 'buildParserConfiguration'), array(), '', FALSE);
$this->mockTemplateParser = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
$this->mockParsedTemplate = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsedTemplateInterface');
$this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
$this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
$this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
$this->mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
$this->mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
$this->mockFlashMessageContainer = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\FlashMessageContainer');
$this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
$this->mockControllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
$this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest));
$this->mockViewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
$this->mockRenderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
$this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
$this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
$this->view->_set('templateParser', $this->mockTemplateParser);
$this->view->_set('objectManager', $this->mockObjectManager);
$this->view->setRenderingContext($this->mockRenderingContext);
$this->mockTemplateCompiler = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
$this->view->_set('templateCompiler', $this->mockTemplateCompiler);
GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager', $this->mockObjectManager);
GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $this->mockContentObject);
/** @var \TYPO3\CMS\Core\Cache\CacheManager|\PHPUnit_Framework_MockObject_MockObject $mockCacheManager */
$mockCacheManager = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array(), array(), '', FALSE);
$mockCache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend', array(), array(), '', FALSE);
$mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager', $mockCacheManager);
}
示例5: viewIsPlacedInViewHelperVariableContainer
/**
* @test
*/
public function viewIsPlacedInViewHelperVariableContainer()
{
$this->viewHelperVariableContainer->expects($this->once())->method('setView')->with($this->view);
$this->view->setRenderingContext($this->renderingContext);
}