本文整理汇总了PHP中TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationManagerInterface::expects方法的具体用法?PHP ConfigurationManagerInterface::expects怎么用?PHP ConfigurationManagerInterface::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
的用法示例。
在下文中一共展示了ConfigurationManagerInterface::expects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array(), array(), '', FALSE);
$this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
$this->mockConfigurationManager->expects($this->any())->method('getContentObject')->will($this->returnValue($this->mockContentObject));
$this->viewHelper = $this->getMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\CropViewHelper', array('renderChildren'));
$this->viewHelper->injectConfigurationManager($this->mockConfigurationManager);
$this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Some Content'));
}
示例2: getTargetPidByPluginSignatureThrowsExceptionIfMoreThanOneTargetPidsWereFound
/**
* @test
* @expectedException \TYPO3\CMS\Extbase\Exception
*/
public function getTargetPidByPluginSignatureThrowsExceptionIfMoreThanOneTargetPidsWereFound()
{
$this->mockConfigurationManager->expects($this->once())->method('getConfiguration')->will($this->returnValue(array('view' => array('defaultPid' => 'auto'))));
$GLOBALS['TSFE']->sys_page = $this->getMock(\TYPO3\CMS\Frontend\Page\PageRepository::class, array('enableFields'));
$GLOBALS['TSFE']->sys_page->expects($this->once())->method('enableFields')->will($this->returnValue(' AND enable_fields'));
$GLOBALS['TYPO3_DB']->expects($this->once())->method('fullQuoteStr')->will($this->returnValue('"pluginSignature"'));
$GLOBALS['TYPO3_DB']->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnValue(array(array('pid' => 123), array('pid' => 124))));
$this->extensionService->getTargetPidByPlugin('ExtensionName', 'SomePlugin');
}
示例3: buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed
/**
* @test
* @expectedException \TYPO3\CMS\Core\Error\Http\PageNotFoundException
*/
public function buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed()
{
$this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
$this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
$this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
$this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
$this->requestBuilder->_set('extensionService', $this->mockExtensionService);
$_GET = array('tx_myextension_pi1' => array('action' => 'someInvalidAction'));
$this->requestBuilder->build();
}
示例4: constructorCreatesContentObjectIfItIsNotSpecified
/**
* @test
*/
public function constructorCreatesContentObjectIfItIsNotSpecified()
{
// FIXME should be compared with identicalTo() - but that does not seem to work
$this->mockConfigurationManager->expects($this->once())->method('setContentObject')->with($this->equalTo($this->mockContentObject));
new \TYPO3\CMS\Fluid\View\StandaloneView();
}
示例5: constructorCreatesContentObjectIfItIsNotSpecified
/**
* @test
*/
public function constructorCreatesContentObjectIfItIsNotSpecified()
{
$this->mockConfigurationManager->expects($this->once())->method('setContentObject')->with($this->identicalTo($this->mockContentObject));
new StandaloneView();
}
示例6: setUp
/**
* Sets up this test case
*
* @return void
*/
public function setUp()
{
$this->configurationManager = $this->getMockBuilder(ConfigurationManager::class)->setMethods(['getConfiguration'])->getMock();
$this->configurationManager->expects($this->once())->method('getConfiguration')->with($this->equalTo('Settings'))->will($this->returnValue(self::$settingsFixture));
$this->sut = new Configuration($this->configurationManager);
}