Skip to content
Snippets Groups Projects
Commit 96fb283d authored by Dmytro Poperechnyy's avatar Dmytro Poperechnyy
Browse files

MAGETWO-86154: Wrong page cached for logged in user

- Update unit test;
parent aba821dc
Branches
No related merge requests found
...@@ -45,6 +45,9 @@ class HttpTest extends \PHPUnit\Framework\TestCase ...@@ -45,6 +45,9 @@ class HttpTest extends \PHPUnit\Framework\TestCase
/** @var ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ /** @var ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */
private $sessionConfigMock; private $sessionConfigMock;
/** @var int */
private $cookieLifeTime = 3600;
protected function setUp() protected function setUp()
{ {
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
...@@ -111,11 +114,11 @@ class HttpTest extends \PHPUnit\Framework\TestCase ...@@ -111,11 +114,11 @@ class HttpTest extends \PHPUnit\Framework\TestCase
$this->sessionConfigMock->expects($this->once()) $this->sessionConfigMock->expects($this->once())
->method('getCookieLifetime') ->method('getCookieLifetime')
->willReturn(3600); ->willReturn($this->cookieLifeTime);
$this->cookieMetadataFactoryMock->expects($this->once()) $this->cookieMetadataFactoryMock->expects($this->once())
->method('createSensitiveCookieMetadata') ->method('createSensitiveCookieMetadata')
->with([CookieMetadata::KEY_DURATION => 3600]) ->with([CookieMetadata::KEY_DURATION => $this->cookieLifeTime])
->willReturn($sensitiveCookieMetadataMock); ->willReturn($sensitiveCookieMetadataMock);
$this->cookieManagerMock->expects($this->once()) $this->cookieManagerMock->expects($this->once())
...@@ -135,12 +138,8 @@ class HttpTest extends \PHPUnit\Framework\TestCase ...@@ -135,12 +138,8 @@ class HttpTest extends \PHPUnit\Framework\TestCase
$this->contextMock->expects($this->once()) $this->contextMock->expects($this->once())
->method('getVaryString') ->method('getVaryString')
->willReturn(null); ->willReturn(null);
$this->sessionConfigMock->expects($this->once())
->method('getCookieLifetime')
->willReturn(120);
$this->cookieMetadataFactoryMock->expects($this->once()) $this->cookieMetadataFactoryMock->expects($this->once())
->method('createSensitiveCookieMetadata') ->method('createSensitiveCookieMetadata')
->with([CookieMetadata::KEY_DURATION => 120])
->willReturn($cookieMetadataMock); ->willReturn($cookieMetadataMock);
$this->cookieManagerMock->expects($this->once()) $this->cookieManagerMock->expects($this->once())
->method('deleteCookie') ->method('deleteCookie')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment