/** * @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); }
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; }