本文整理汇总了PHP中Aimeos\MShop\Locale\Manager\Factory::injectManager方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::injectManager方法的具体用法?PHP Factory::injectManager怎么用?PHP Factory::injectManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aimeos\MShop\Locale\Manager\Factory
的用法示例。
在下文中一共展示了Factory::injectManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCustomCache
/**
* @test
*/
public function getCustomCache()
{
$request = $this->getMockBuilder('\\TYPO3\\Flow\\Mvc\\ActionRequest')->setMethods(array('getArguments'))->disableOriginalConstructor()->getMock();
$request->expects($this->once())->method('getArguments')->will($this->returnValue(array()));
$localeManager = $this->getMockBuilder('\\Aimeos\\MShop\\Locale\\Manager\\Standard')->setMethods(array('bootstrap'))->disableOriginalConstructor()->getMock();
$localeManager->expects($this->once())->method('bootstrap')->will($this->returnValue(new \Aimeos\MShop\Locale\Item\Standard(array('locale.languageid' => 'de'))));
\Aimeos\MShop\Locale\Manager\Factory::injectManager('\\Aimeos\\MShop\\Locale\\Manager\\Standard', $localeManager);
$this->object->injectSettings(array('flow' => array('cache' => array('name' => 'Custom'))));
$context = $this->object->get($request);
$this->assertInstanceOf('\\Aimeos\\MShop\\Context\\Item\\Iface', $context);
}
示例2: getSiteMock
protected function getSiteMock(array $methods)
{
$name = 'ClientJsonAdmStandard';
$this->context->getConfig()->set('mshop/locale/manager/name', $name);
$stub = $this->getMockBuilder('\\Aimeos\\MShop\\Locale\\Manager\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('getSubManager'))->getMock();
$siteStub = $this->getMockBuilder('\\Aimeos\\MShop\\Locale\\Manager\\Site\\Standard')->setConstructorArgs(array($this->context))->setMethods($methods)->getMock();
$stub->expects($this->once())->method('getSubManager')->will($this->returnValue($siteStub));
\Aimeos\MShop\Locale\Manager\Factory::injectManager('\\Aimeos\\MShop\\Locale\\Manager\\' . $name, $stub);
return $siteStub;
}