12
12
use Magento \Framework \View \Asset \Repository as AssetRepository ;
13
13
use Magento \Framework \View \Asset \MergeableInterface ;
14
14
use Magento \Framework \View \Asset \MergeStrategyInterface ;
15
+ use Magento \Framework \App \View \Deployment \Version \StorageInterface ;
15
16
16
17
/**
17
18
* Class MergedTest
@@ -43,6 +44,11 @@ class MergedTest extends \PHPUnit\Framework\TestCase
43
44
*/
44
45
private $ assetRepo ;
45
46
47
+ /**
48
+ * @var StorageInterface|\PHPUnit_Framework_MockObject_MockObject
49
+ */
50
+ private $ versionStorage ;
51
+
46
52
protected function setUp ()
47
53
{
48
54
$ this ->assetJsOne = $ this ->getMockForAbstractClass (MergeableInterface::class);
@@ -66,6 +72,7 @@ protected function setUp()
66
72
$ this ->assetRepo = $ this ->getMockBuilder (AssetRepository::class)
67
73
->disableOriginalConstructor ()
68
74
->getMock ();
75
+ $ this ->versionStorage = $ this ->createMock (StorageInterface::class);
69
76
}
70
77
71
78
/**
@@ -74,7 +81,13 @@ protected function setUp()
74
81
*/
75
82
public function testConstructorNothingToMerge ()
76
83
{
77
- new \Magento \Framework \View \Asset \Merged ($ this ->logger , $ this ->mergeStrategy , $ this ->assetRepo , []);
84
+ new \Magento \Framework \View \Asset \Merged (
85
+ $ this ->logger ,
86
+ $ this ->mergeStrategy ,
87
+ $ this ->assetRepo ,
88
+ [],
89
+ $ this ->versionStorage
90
+ );
78
91
}
79
92
80
93
/**
@@ -90,6 +103,7 @@ public function testConstructorRequireMergeInterface()
90
103
'mergeStrategy ' => $ this ->mergeStrategy ,
91
104
'assetRepo ' => $ this ->assetRepo ,
92
105
'assets ' => [$ this ->assetJsOne , $ assetUrl ],
106
+ 'versionStorage ' => $ this ->versionStorage ,
93
107
]);
94
108
}
95
109
@@ -109,6 +123,7 @@ public function testConstructorIncompatibleContentTypes()
109
123
'mergeStrategy ' => $ this ->mergeStrategy ,
110
124
'assetRepo ' => $ this ->assetRepo ,
111
125
'assets ' => [$ this ->assetJsOne , $ assetCss ],
126
+ 'versionStorage ' => $ this ->versionStorage ,
112
127
]);
113
128
}
114
129
@@ -124,6 +139,7 @@ public function testIteratorInterfaceMerge()
124
139
'mergeStrategy ' => $ this ->mergeStrategy ,
125
140
'assetRepo ' => $ this ->assetRepo ,
126
141
'assets ' => $ assets ,
142
+ 'versionStorage ' => $ this ->versionStorage ,
127
143
]);
128
144
129
145
$ mergedAsset = $ this ->createMock (\Magento \Framework \View \Asset \File::class);
@@ -158,6 +174,7 @@ public function testIteratorInterfaceMergeFailure()
158
174
'mergeStrategy ' => $ this ->mergeStrategy ,
159
175
'assetRepo ' => $ this ->assetRepo ,
160
176
'assets ' => [$ this ->assetJsOne , $ this ->assetJsTwo , $ assetBroken ],
177
+ 'versionStorage ' => $ this ->versionStorage ,
161
178
]);
162
179
163
180
$ this ->logger ->expects ($ this ->once ())->method ('critical ' )->with ($ this ->identicalTo ($ mergeError ));
0 commit comments