public function testGetTargetStorePostData() { $store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock(); $store->expects($this->any())->method('getCode')->will($this->returnValue('new-store')); $storeSwitchUrl = 'stores/store/switch'; $this->urlBuilder->expects($this->any())->method('getUrl')->with($storeSwitchUrl)->willReturnArgument(0); $this->corePostDataHelper->expects($this->any())->method('getPostData')->with($storeSwitchUrl, ['___store' => 'new-store']); $this->switcher->getTargetStorePostData($store); }
public function testGetTargetStorePostData() { $store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock(); $store->expects($this->any())->method('getCode')->will($this->returnValue('new-store')); $currentStore = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock(); $currentStore->expects($this->any())->method('getCode')->will($this->returnValue('current-store')); $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($currentStore)); $this->corePostDataHelper->expects($this->any())->method('getPostData')->with(null, ['___store' => 'new-store', '___from_store' => 'current-store']); $this->switcher->getTargetStorePostData($store); }
/** * {@inheritdoc} */ public function getTargetStorePostData(\Magento\Store\Model\Store $store, $data = array()) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getTargetStorePostData'); if (!$pluginInfo) { return parent::getTargetStorePostData($store, $data); } else { return $this->___callPlugins('getTargetStorePostData', func_get_args(), $pluginInfo); } }