Exemplo n.º 1
0
 public function testProcessDeleteItem()
 {
     $this->context->setUserId('123');
     $view = $this->object->getView();
     $param = array('wat_action' => 'delete', 'wat_id' => 321);
     $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
     $view->addHelper('param', $helper);
     $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard')->setMethods(array('deleteItems'))->setConstructorArgs(array($this->context))->getMock();
     $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard')->setMethods(array('getSubManager'))->setConstructorArgs(array($this->context))->getMock();
     $name = 'ClientHtmlAccountWatchDefaultProcess';
     $this->context->getConfig()->set('mshop/customer/manager/name', $name);
     \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub);
     $managerStub->expects($this->atLeastOnce())->method('getSubManager')->will($this->returnValue($listManagerStub));
     $listManagerStub->expects($this->once())->method('deleteItems');
     $this->object->process();
 }