39 $this->cookieManager = $this->getMockBuilder(\
Magento\Framework\Stdlib\Cookie\PhpCookieManager::class)
40 ->disableOriginalConstructor()
42 $this->metadataFactory = $this->getMockBuilder(\
Magento\Framework\Stdlib\Cookie\CookieMetadataFactory::class)
43 ->disableOriginalConstructor()
45 $this->metadata = $this->getMockBuilder(\
Magento\Framework\Stdlib\Cookie\CookieMetadata::class)
46 ->disableOriginalConstructor()
48 $this->sessionManager = $this->getMockBuilder(\
Magento\Framework\Session\SessionManager::class)
49 ->disableOriginalConstructor()
52 $this->plugin =
new SessionChecker($this->cookieManager, $this->metadataFactory);
63 $phpSessionCookieName =
'PHPSESSID';
64 $frontendSessionCookieName =
'mage-cache-sessid';
65 $this->sessionManager->expects($this->once())
67 ->willReturn($phpSessionCookieName);
68 $this->cookieManager->expects($this->exactly(2))
71 [$phpSessionCookieName],
72 [$frontendSessionCookieName]
74 ->willReturnOnConsecutiveCalls(
false,
$result);
76 $this->metadataFactory->expects($this->{$callCount}())
77 ->method(
'createCookieMetadata')
78 ->willReturn($this->metadata);
79 $this->metadata->expects($this->{$callCount}())
82 $this->cookieManager->expects($this->{$callCount}())
83 ->method(
'deleteCookie')
84 ->with(
'mage-cache-sessid', $this->metadata);
86 $this->plugin->beforeStart($this->sessionManager);
beforeStartDataProvider()
testBeforeStart($result, $callCount)