File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -930,8 +930,8 @@ public function getCssFilesContent(array $files)
930
930
foreach ($ files as $ file ) {
931
931
$ asset = $ this ->_assetRepo ->createAsset ($ file , $ designParams );
932
932
$ pubDirectory = $ this ->getPubDirectory ($ asset ->getContext ()->getBaseDirType ());
933
- if ($ pubDirectory ->isExist ($ asset ->getRelativeSourceFilePath ())) {
934
- $ css .= $ pubDirectory ->readFile ($ asset ->getRelativeSourceFilePath ());
933
+ if ($ pubDirectory ->isExist ($ asset ->getPath ())) {
934
+ $ css .= $ pubDirectory ->readFile ($ asset ->getPath ());
935
935
} else {
936
936
$ css .= $ asset ->getContent ();
937
937
}
Original file line number Diff line number Diff line change 7
7
use Magento \Email \Model \Template \Css \Processor ;
8
8
use Magento \Email \Model \Template \Filter ;
9
9
use Magento \Framework \App \Area ;
10
+ use Magento \Framework \App \Filesystem \DirectoryList ;
10
11
use Magento \Framework \Filesystem \Directory \ReadInterface ;
12
+ use Magento \Framework \View \Asset \File \FallbackContext ;
11
13
12
14
/**
13
15
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -292,21 +294,25 @@ public function testGetCssFilesContent()
292
294
'theme ' => 'themeId ' ,
293
295
'locale ' => 'localeId ' ,
294
296
];
295
-
296
297
$ filter = $ this ->getModel ();
297
298
298
299
$ asset = $ this ->getMockBuilder (\Magento \Framework \View \Asset \File::class)
299
300
->disableOriginalConstructor ()
300
301
->getMock ();
301
- $ fallbackContext = $ this ->getMockBuilder (\Magento \Framework \View \Asset \File \FallbackContext::class)
302
+
303
+ $ fallbackContext = $ this ->getMockBuilder (FallbackContext::class)
302
304
->disableOriginalConstructor ()
303
305
->getMock ();
304
306
$ fallbackContext ->expects ($ this ->once ())
305
- ->method ('getPath ' )
306
- ->willReturn ($ path );
307
+ ->method ('getBaseDirType ' )
308
+ ->willReturn (DirectoryList:: STATIC_VIEW );
307
309
$ asset ->expects ($ this ->atLeastOnce ())
308
310
->method ('getContext ' )
309
311
->willReturn ($ fallbackContext );
312
+
313
+ $ asset ->expects ($ this ->atLeastOnce ())
314
+ ->method ('getPath ' )
315
+ ->willReturn ($ path . DIRECTORY_SEPARATOR . $ file );
310
316
$ this ->assetRepo ->expects ($ this ->once ())
311
317
->method ('createAsset ' )
312
318
->with ($ file , $ designParams )
You can’t perform that action at this time.
0 commit comments