Exemple #1
0
 public function testBeforeDispatchNoStoreCookie()
 {
     $storeCode = null;
     $this->storeCookieManagerMock->expects($this->once())->method('getStoreCodeFromCookie')->willReturn($storeCode);
     $this->storeManagerMock->expects($this->never())->method('getDefaultStoreView')->willReturn($this->storeMock);
     $this->storeRepositoryMock->expects($this->never())->method('getActiveStoreByCode');
     $this->storeCookieManagerMock->expects($this->never())->method('deleteStoreCookie')->with($this->storeMock);
     $this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
 }
 public function testAroundDispatchNoStoreCookie()
 {
     $storeCode = null;
     $this->storeManagerMock->expects($this->once())->method('getDefaultStoreView')->willReturn($this->storeMock);
     $this->storeCookieManagerMock->expects($this->once())->method('getStoreCodeFromCookie')->willReturn($storeCode);
     $this->storeRepositoryMock->expects($this->never())->method('getActiveStoreByCode');
     $this->storeCookieManagerMock->expects($this->never())->method('deleteStoreCookie')->with($this->storeMock);
     $this->assertEquals('ExpectedValue', $this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock));
 }