/** * {@inheritdoc} */ public function move($parentId, $afterCategoryId) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'move'); if (!$pluginInfo) { return parent::move($parentId, $afterCategoryId); } else { return $this->___callPlugins('move', func_get_args(), $pluginInfo); } }
public function testMovePrimaryWorkflow() { $indexer = $this->getMock('stdClass', ['isScheduled']); $indexer->expects($this->once())->method('isScheduled')->will($this->returnValue(true)); $this->indexerRegistry->expects($this->once())->method('get')->with('catalog_category_product')->will($this->returnValue($indexer)); $parentCategory = $this->getMock('Magento\\Catalog\\Model\\Category', ['getId', 'setStoreId', 'load'], [], '', false); $parentCategory->expects($this->any())->method('getId')->will($this->returnValue(5)); $parentCategory->expects($this->any())->method('setStoreId')->will($this->returnSelf()); $parentCategory->expects($this->any())->method('load')->will($this->returnSelf()); $this->categoryRepository->expects($this->any())->method('get')->will($this->returnValue($parentCategory)); $store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false); $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); $this->category->setId(3); $this->category->move(5, 7); }
/** * @expectedException \Magento\Framework\Exception\LocalizedException */ public function testMoveWrongId() { $this->_model->move(100, 0); }