当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::injectManager方法代码示例

本文整理汇总了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);
 }
开发者ID:aimeos,项目名称:aimeos-flow,代码行数:14,代码来源:ContextTest.php

示例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;
 }
开发者ID:aimeos,项目名称:ai-admin-jsonadm,代码行数:10,代码来源:StandardTest.php


注:本文中的Aimeos\MShop\Locale\Manager\Factory::injectManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。