本文整理汇总了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();
}
示例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();
}
示例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);
}