23 private $storeManagerMock;
26 private $scopeConfigMock;
32 private $serializerMock;
36 $this->contextMock = $this->getMockBuilder(Context::class)
37 ->disableOriginalConstructor()
40 $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class)
43 $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
46 $this->encoderMock = $this->getMockBuilder(\
Magento\Framework\Json\EncoderInterface::class)
49 $this->serializerMock = $this->getMockBuilder(\
Magento\Framework\Serialize\Serializer\Json::class)
52 $this->contextMock->expects($this->exactly(2))
53 ->method(
'getStoreManager')
54 ->willReturn($this->storeManagerMock);
56 $this->contextMock->expects($this->once())
57 ->method(
'getScopeConfig')
58 ->willReturn($this->scopeConfigMock);
72 $storeMock = $this->getMockBuilder(StoreInterface::class)
73 ->setMethods([
'getWebsiteId'])
74 ->getMockForAbstractClass();
76 $storeMock->expects($this->any())
77 ->method(
'getWebsiteId')
80 $this->storeManagerMock->expects($this->any())
83 ->willReturn($storeMock);
85 $this->assertEquals(
$storeId, $this->model->getWebsiteId());
92 'Magento_Customer/js/invalidation-processor' => [
93 'invalidationRules' => [
95 'Magento_Customer/js/invalidation-rules/website-rule' => [
106 $this->serializerMock->expects($this->any())
107 ->method(
'serialize')
109 ->willReturn(json_encode(
$rules));
113 $this->model->encodeConfiguration(
$rules)
testEncodeConfiguration()