16 private $quoteResolver;
36 $this->cacheMock = $this->createMock(\
Magento\Framework\
Config\CacheInterface::class);
37 $this->serializer = $this->getMockForAbstractClass(SerializerInterface::class);
38 $this->quoteResolver = new \Magento\Quote\Model\QueryResolver(
41 'connection_config_cache',
48 $serializedData =
'{"checkout":true}';
49 $data = [
'checkout' =>
true];
51 ->expects($this->once())
53 ->with(
'connection_config_cache')
54 ->willReturn($serializedData);
55 $this->serializer->expects($this->once())
56 ->method(
'unserialize')
57 ->with($serializedData)
59 $this->assertTrue($this->quoteResolver->isSingleQuery());
70 $data = [
'checkout' => $isSingleQuery];
71 $serializedData =
'{"checkout":true}';
73 ->expects($this->once())
75 ->with(
'connection_config_cache')
77 $this->serializer->expects($this->never())
78 ->method(
'unserialize');
80 ->expects($this->once())
81 ->method(
'getConnectionName')
82 ->with(
'checkout_setup')
83 ->willReturn($connectionName);
84 $this->serializer->expects($this->once())
87 ->willReturn($serializedData);
89 ->expects($this->once())
91 ->with($serializedData,
'connection_config_cache', []);
92 $this->assertEquals($isSingleQuery, $this->quoteResolver->isSingleQuery());
testIsSingleQueryWhenDataWereCached()
testIsSingleQueryWhenDataNotCached($connectionName, $isSingleQuery)
isSingleQueryWhenDataNotCachedDataProvider()