コード例 #1
0
ファイル: SessionTest.php プロジェクト: Atlis/docker-magento2
 /**
  * @covers \Magento\Persistent\Model\Session::_afterDeleteCommit
  * @covers \Magento\Persistent\Model\Session::removePersistentCookie
  */
 public function testAfterDeleteCommit()
 {
     $cookiePath = 'some_path';
     $this->_configMock->expects($this->once())->method('getCookiePath')->will($this->returnValue($cookiePath));
     $this->_cookieMock->expects($this->once())->method('set')->with(\Magento\Persistent\Model\Session::COOKIE_NAME, $this->anything(), $this->anything(), $cookiePath);
     $this->_model->delete();
 }
コード例 #2
0
 /**
  * @covers \Magento\Persistent\Model\Session::_afterDeleteCommit
  * @covers \Magento\Persistent\Model\Session::removePersistentCookie
  */
 public function testAfterDeleteCommit()
 {
     $cookiePath = 'some_path';
     $this->configMock->expects($this->once())->method('getCookiePath')->will($this->returnValue($cookiePath));
     $cookieMetadataMock = $this->getMockBuilder('Magento\\Framework\\Stdlib\\Cookie\\CookieMetadata')->disableOriginalConstructor()->getMock();
     $cookieMetadataMock->expects($this->once())->method('setPath')->with($cookiePath)->will($this->returnSelf());
     $this->cookieMetadataFactoryMock->expects($this->once())->method('createCookieMetadata')->will($this->returnValue($cookieMetadataMock));
     $this->cookieManagerMock->expects($this->once())->method('deleteCookie')->with(\Magento\Persistent\Model\Session::COOKIE_NAME, $cookieMetadataMock);
     $this->session->delete();
 }