@@ -45,7 +45,7 @@ public function testInMemoryDecorator($method, $expected)
45
45
*/
46
46
private function prepareRequestedAsMinifiedMock ()
47
47
{
48
- $ this ->_asset ->expects ($ this ->exactly (2 ))->method ('getPath ' )->will ($ this ->returnValue ('test/library .min.js ' ));
48
+ $ this ->_asset ->expects ($ this ->exactly (2 ))->method ('getPath ' )->will ($ this ->returnValue ('test/admin .min.js ' ));
49
49
$ this ->_asset ->expects ($ this ->once ())->method ('getSourceFile ' )->will ($ this ->returnValue ('source_file ' ));
50
50
$ this ->_asset ->expects ($ this ->once ())->method ('getFilePath ' )->will ($ this ->returnValue ('file_path ' ));
51
51
$ this ->_asset ->expects ($ this ->once ())->method ('getContext ' )->will ($ this ->returnValue ('context ' ));
@@ -60,7 +60,7 @@ public function inMemoryDecoratorDataProvider()
60
60
return [
61
61
['getUrl ' , 'url ' ],
62
62
['getSourceFile ' , 'source_file ' ],
63
- ['getPath ' , 'test/library .min.js ' ],
63
+ ['getPath ' , 'test/admin .min.js ' ],
64
64
['getFilePath ' , 'file_path ' ],
65
65
['getContext ' , 'context ' ],
66
66
];
@@ -95,31 +95,31 @@ public function testGetContent()
95
95
$ this ->_adapter ->expects ($ this ->never ())->method ('minify ' );
96
96
$ this ->_staticViewDir ->expects ($ this ->exactly (2 ))
97
97
->method ('readFile ' )
98
- ->with ('test/library .min.js ' )
98
+ ->with ('test/admin .min.js ' )
99
99
->will ($ this ->returnValue ('content ' ));
100
100
$ this ->assertEquals ('content ' , $ this ->_model ->getContent ());
101
101
$ this ->assertEquals ('content ' , $ this ->_model ->getContent ());
102
102
}
103
103
104
104
public function testHasPreminifiedFile ()
105
105
{
106
- $ this ->_asset ->expects ($ this ->exactly (2 ))->method ('getPath ' )->will ($ this ->returnValue ('test/library .js ' ));
106
+ $ this ->_asset ->expects ($ this ->exactly (2 ))->method ('getPath ' )->will ($ this ->returnValue ('test/admin .js ' ));
107
107
$ this ->_asset ->expects ($ this ->atLeastOnce ())
108
108
->method ('getSourceFile ' )
109
- ->will ($ this ->returnValue ('/foo/bar/test/library .js ' ));
109
+ ->will ($ this ->returnValue ('/foo/bar/test/admin .js ' ));
110
110
$ this ->_asset ->expects ($ this ->once ())->method ('getFilePath ' )->will ($ this ->returnValue ('file_path ' ));
111
111
$ this ->_asset ->expects ($ this ->once ())->method ('getContext ' )->will ($ this ->returnValue ('context ' ));
112
112
$ this ->_asset ->expects ($ this ->once ())->method ('getUrl ' )->will ($ this ->returnValue ('url ' ));
113
113
$ this ->_rootDir ->expects ($ this ->once ())
114
114
->method ('getRelativePath ' )
115
- ->with ('/foo/bar/test/library .min.js ' )
116
- ->will ($ this ->returnValue ('test/library .min.js ' ));
115
+ ->with ('/foo/bar/test/admin .min.js ' )
116
+ ->will ($ this ->returnValue ('test/admin .min.js ' ));
117
117
$ this ->_rootDir ->expects ($ this ->once ())
118
118
->method ('isExist ' )
119
- ->with ('test/library .min.js ' )
119
+ ->with ('test/admin .min.js ' )
120
120
->will ($ this ->returnValue (true ));
121
121
$ this ->_adapter ->expects ($ this ->never ())->method ('minify ' );
122
- $ this ->assertEquals ('test/library .min.js ' , $ this ->_model ->getPath ());
122
+ $ this ->assertEquals ('test/admin .min.js ' , $ this ->_model ->getPath ());
123
123
}
124
124
125
125
public function testMinify ()
@@ -128,7 +128,7 @@ public function testMinify()
128
128
$ this ->_asset ->expects ($ this ->once ())->method ('getContent ' )->will ($ this ->returnValue ('content ' ));
129
129
$ this ->_adapter ->expects ($ this ->once ())->method ('minify ' )->with ('content ' )->will ($ this ->returnValue ('mini ' ));
130
130
$ this ->_staticViewDir ->expects ($ this ->once ())->method ('writeFile ' )->with ($ this ->anything (), 'mini ' );
131
- $ this ->assertStringMatchesFormat ('%s_library .min.js ' , $ this ->_model ->getFilePath ());
131
+ $ this ->assertStringMatchesFormat ('%s_admin .min.js ' , $ this ->_model ->getFilePath ());
132
132
}
133
133
134
134
public function testMinificationFailed ()
@@ -142,15 +142,15 @@ public function testMinificationFailed()
142
142
$ this ->_asset ->expects ($ this ->once ())->method ('getFilePath ' )->will ($ this ->returnValue ('file_path ' ));
143
143
$ this ->_asset ->expects ($ this ->once ())->method ('getContext ' )->will ($ this ->returnValue ('context ' ));
144
144
$ this ->_asset ->expects ($ this ->once ())->method ('getUrl ' )->will ($ this ->returnValue ('url ' ));
145
- $ this ->assertEquals ('test/library .js ' , $ this ->_model ->getPath ());
145
+ $ this ->assertEquals ('test/admin .js ' , $ this ->_model ->getPath ());
146
146
}
147
147
148
148
public function testShouldNotMinifyCozExists ()
149
149
{
150
150
$ this ->prepareAttemptToMinifyMock (true );
151
151
// IS_EXISTS is assumed by default, so nothing to mock here
152
152
$ this ->_adapter ->expects ($ this ->never ())->method ('minify ' );
153
- $ this ->assertStringMatchesFormat ('%s_library .min.js ' , $ this ->_model ->getFilePath ());
153
+ $ this ->assertStringMatchesFormat ('%s_admin .min.js ' , $ this ->_model ->getFilePath ());
154
154
}
155
155
156
156
/**
@@ -173,16 +173,16 @@ public function testMinifyMtime($mtimeOrig, $mtimeMinified, $isMinifyExpected)
173
173
$ this ->_rootDir ->expects ($ this ->any ())
174
174
->method ('getRelativePath ' )
175
175
->will ($ this ->returnValueMap ([
176
- ['/foo/bar/test/library .min.js ' , 'test/library .min.js ' ],
177
- ['/foo/bar/test/library .js ' , 'test/library .js ' ],
176
+ ['/foo/bar/test/admin .min.js ' , 'test/admin .min.js ' ],
177
+ ['/foo/bar/test/admin .js ' , 'test/admin .js ' ],
178
178
]));
179
179
$ this ->_rootDir ->expects ($ this ->once ())
180
180
->method ('isExist ' )
181
- ->with ('test/library .min.js ' )
181
+ ->with ('test/admin .min.js ' )
182
182
->will ($ this ->returnValue (false ));
183
183
$ this ->_rootDir ->expects ($ this ->once ())
184
184
->method ('stat ' )
185
- ->with ('test/library .js ' )
185
+ ->with ('test/admin .js ' )
186
186
->will ($ this ->returnValue (['mtime ' => $ mtimeOrig ]));
187
187
$ this ->_staticViewDir ->expects ($ this ->once ())
188
188
->method ('stat ' )
@@ -198,7 +198,7 @@ public function testMinifyMtime($mtimeOrig, $mtimeMinified, $isMinifyExpected)
198
198
} else {
199
199
$ this ->_adapter ->expects ($ this ->never ())->method ('minify ' );
200
200
}
201
- $ this ->assertStringMatchesFormat ('%s_library .min.js ' , $ model ->getFilePath ());
201
+ $ this ->assertStringMatchesFormat ('%s_admin .min.js ' , $ model ->getFilePath ());
202
202
}
203
203
204
204
/**
0 commit comments