20 private $integrationConfigModel;
25 private $configCacheTypeMock;
30 private $configReaderMock;
39 $this->configCacheTypeMock = $this->getMockBuilder(\
Magento\
Integration\Model\Cache\TypeIntegration::class)
40 ->disableOriginalConstructor()
43 ->disableOriginalConstructor()
45 $this->serializer = $this->getMockBuilder(SerializerInterface::class)
46 ->disableOriginalConstructor()
49 $this->configCacheTypeMock,
50 $this->configReaderMock,
57 $integrations = [
'foo',
'bar',
'baz'];
58 $serializedIntegrations =
'["foo","bar","baz"]';
59 $this->configCacheTypeMock->expects($this->once())
62 ->will($this->returnValue($serializedIntegrations));
63 $this->serializer->expects($this->once())
64 ->method(
'unserialize')
65 ->with($serializedIntegrations)
66 ->willReturn($integrations);
68 $this->assertEquals($integrations, $this->integrationConfigModel->getIntegrations());
73 $integrations = [
'foo',
'bar',
'baz'];
74 $serializedIntegrations =
'["foo","bar","baz"]';
75 $this->configCacheTypeMock->expects($this->once())
78 ->will($this->returnValue(
null));
79 $this->configReaderMock->expects($this->once())
81 ->will($this->returnValue($integrations));
82 $this->serializer->expects($this->once())
85 ->willReturn($serializedIntegrations);
86 $this->configCacheTypeMock->expects($this->once())
89 ->will($this->returnValue(
null));
91 $this->assertEquals($integrations, $this->integrationConfigModel->getIntegrations());
testGetIntegrationsFromConfigReader()
testGetIntegrationsFromConfigCacheType()