예제 #1
0
 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);
 }
예제 #2
0
 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);
 }