public function testBeforeGenerateXmlNoDepersonalize() { $this->depersonalizeCheckerMock->expects($this->once())->method('checkIfDepersonalize')->willReturn(false); $this->customerSessionMock->expects($this->never())->method('getCustomerGroupId'); $this->sessionMock->expects($this->never())->method('getData'); $output = $this->plugin->beforeGenerateXml($this->layoutMock); $this->assertEquals([], $output); }
/** * Test beforeGenerateXml method with enabled module PageCache and request is Ajax and Layout is not cacheable */ public function testBeforeGenerateXmlLayoutIsNotCacheable() { $this->moduleManagerMock->expects($this->once())->method('isEnabled')->with('Magento_PageCache')->will($this->returnValue(true)); $this->cacheConfigMock->expects($this->once())->method('isEnabled')->will($this->returnValue(true)); $this->requestMock->expects($this->once())->method('isAjax')->will($this->returnValue(false)); $this->layoutMock->expects($this->once())->method('isCacheable')->will($this->returnValue(false)); $this->customerSessionMock->expects($this->never())->method('getCustomerGroupId'); $output = $this->plugin->beforeGenerateXml($this->layoutMock); $this->assertEquals(array(), $output); }