43 private $deploymentConfigMock;
52 $this->resolver = $this->getMockForAbstractClass(ResolverInterface::class);
53 $this->minifier = $this->getMockForAbstractClass(MinifierInterface::class);
54 $this->state = $this->createMock(State::class);
55 $this->assetConfig = $this->getMockForAbstractClass(ConfigInterface::class);
56 $this->deploymentConfigMock = $this->createMock(DeploymentConfig::class);
62 $this->deploymentConfigMock
72 ->expects($this->once())
73 ->method(
'isMinifyHtml')
76 $theme = $this->getMockForAbstractClass(\
Magento\Framework\View\Design\ThemeInterface::class);
77 $expected =
'some/file.ext';
79 $this->state->expects($this->once())
82 $this->resolver->expects($this->once())
85 ->willReturn($expected);
87 $actual = $this->
object->getFile(
'frontend',
$theme,
'file.ext',
'Magento_Module');
88 $this->assertSame($expected, $actual);
102 ->expects($this->once())
103 ->method(
'isMinifyHtml')
106 $theme = $this->getMockForAbstractClass(\
Magento\Framework\View\Design\ThemeInterface::class);
107 $expected =
'some/file.ext';
108 $expectedMinified =
'/path/to/minified/some/file.ext';
110 $this->deploymentConfigMock->expects($this->any())
111 ->method(
'getConfigData')
116 $this->state->expects($this->once())
119 $this->resolver->expects($this->once())
122 ->willReturn($expected);
123 $this->minifier->expects($this->once())
126 ->willReturn($expectedMinified);
128 $actual = $this->
object->getFile(
'frontend',
$theme,
'file.ext',
'Magento_Module');
129 $this->assertSame($expectedMinified, $actual);
135 ->expects($this->once())
136 ->method(
'isMinifyHtml')
139 $theme = $this->getMockForAbstractClass(\
Magento\Framework\View\Design\ThemeInterface::class);
140 $expected =
'some/file.ext';
142 $this->resolver->expects($this->once())
145 ->willReturn($expected);
147 $this->state->expects($this->never())
150 $actual = $this->
object->getFile(
'frontend',
$theme,
'file.ext',
'Magento_Module');
151 $this->assertSame($expected, $actual);
const CONFIG_PATH_FORCE_HTML_MINIFICATION
testGetFileWhenModifiedNeeded($mode, $onDemandInProduction, $forceMinification, $method)
const CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
testGetFileIfMinificationIsDisabled()
getMinifiedDataProvider()
testGetFileWhenStateDeveloper()