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


PHP MShop_Factory::injectManager方法代码示例

本文整理汇总了PHP中MShop_Factory::injectManager方法的典型用法代码示例。如果您正苦于以下问题:PHP MShop_Factory::injectManager方法的具体用法?PHP MShop_Factory::injectManager怎么用?PHP MShop_Factory::injectManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MShop_Factory的用法示例。


在下文中一共展示了MShop_Factory::injectManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testProcess

 public function testProcess()
 {
     $type = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT;
     $manager = MShop_Customer_Manager_Factory::createManager($this->_context);
     $search = $manager->createSearch();
     $search->setSlice(0, 1);
     $result = $manager->searchItems($search);
     if (($customerItem = reset($result)) === false) {
         throw new Exception('No customer item found');
     }
     $addrItem = $customerItem->getPaymentAddress();
     $addrItem->setEmail('unittest@aimeos.org');
     $basketCntl = Controller_Frontend_Basket_Factory::createController($this->_context);
     $basketCntl->setAddress($type, $addrItem);
     $view = TestHelper::getView();
     $view->orderBasket = $basketCntl->get();
     $this->_object->setView($view);
     $orderBaseStub = $this->getMockBuilder('MShop_Order_Manager_Base_Default')->setConstructorArgs(array($this->_context))->setMethods(array('saveItem'))->getMock();
     $customerStub = $this->getMockBuilder('MShop_Customer_Manager_Default')->setConstructorArgs(array($this->_context))->setMethods(array('saveItem'))->getMock();
     $orderBaseStub->expects($this->once())->method('saveItem');
     $customerStub->expects($this->once())->method('saveItem');
     MShop_Factory::injectManager($this->_context, 'customer', $customerStub);
     MShop_Factory::injectManager($this->_context, 'order/base', $orderBaseStub);
     $this->_object->process();
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:25,代码来源:DefaultTest.php

示例2: testRun

 public function testRun()
 {
     $stub = $this->getMockBuilder('MShop_Product_Manager_List_Default')->setConstructorArgs(array($this->_context))->setMethods(array('deleteItems', 'saveItem'))->getMock();
     MShop_Factory::injectManager($this->_context, 'product/list', $stub);
     $stub->expects($this->atLeastOnce())->method('deleteItems');
     $stub->expects($this->atLeastOnce())->method('saveItem');
     $this->_object->run();
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:8,代码来源:DefaultTest.php

示例3: testProcessDirectDebit

 public function testProcessDirectDebit()
 {
     $mock = $this->getMockBuilder('MShop_Order_Manager_Base_Default')->setConstructorArgs(array($this->_context))->setMethods(array('store'))->getMock();
     MShop_Factory::injectManager($this->_context, 'order/base', $mock);
     $view = $this->_object->getView();
     $param = array('c_step' => 'process');
     $helper = new MW_View_Helper_Parameter_Default($view, $param);
     $view->addHelper('param', $helper);
     $orderid = $this->_getOrder('2009-03-18 16:14:32')->getId();
     $this->_context->getSession()->set('arcavias/orderid', $orderid);
     $this->_object->process();
     $this->assertEquals(0, count($view->get('standardErrorList', array())));
     $this->assertEquals('POST', $view->standardMethod);
     $this->assertEquals(array(), $view->standardProcessParams);
     $this->assertEquals(true, $view->standardUrlExternal);
     $this->assertEquals('http://baseurl/checkout/standard/?c_step=payment', $view->standardUrlPayment);
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:17,代码来源:DefaultTest.php


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