8 use \Magento\Framework\App\Cache\Type\FrontendPool;
34 $this->_objectManager = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
35 $this->deploymentConfig = $this->createMock(\
Magento\Framework\
App\DeploymentConfig::class);
36 $this->_cachePool = $this->createMock(\
Magento\Framework\
App\
Cache\Frontend\Pool::class);
38 $this->_objectManager,
39 $this->deploymentConfig,
41 [
'fixture_cache_type' =>
'fixture_frontend_id']
52 public function testGet($fixtureConfigData, $inputCacheType, $expectedFrontendId)
54 $this->deploymentConfig->expects(
61 $this->returnValue($fixtureConfigData)
64 $cacheFrontend = $this->createMock(\
Magento\Framework\
Cache\FrontendInterface::class);
65 $this->_cachePool->expects(
72 $this->returnValue($cacheFrontend)
75 $accessProxy = $this->createMock(\
Magento\Framework\
App\
Cache\Type\AccessProxy::class);
76 $this->_objectManager->expects(
82 $this->identicalTo([
'frontend' => $cacheFrontend,
'identifier' => $inputCacheType])
84 $this->returnValue($accessProxy)
87 $this->assertSame($accessProxy, $this->_model->get($inputCacheType));
89 $this->assertSame($accessProxy, $this->_model->get($inputCacheType));
99 'type' => [
'fixture_cache_type' => [
'frontend' =>
'configured_frontend_id']],
101 $configData2 = [
'frontend' => [],
'type' => [
'fixture_cache_type' => [
'frontend' =>
null]]];
102 $configData3 = [
'frontend' => [],
'type' => [
'unknown_cache_type' => [
'frontend' =>
null]]];
104 'retrieval from config' => [$configData1,
'fixture_cache_type',
'configured_frontend_id'],
105 'retrieval from map' => [$configData2,
'fixture_cache_type',
'fixture_frontend_id'],
106 'fallback to default id' => [
108 'unknown_cache_type',
testGet($fixtureConfigData, $inputCacheType, $expectedFrontendId)
const DEFAULT_FRONTEND_ID