@@ -25,7 +25,7 @@ class DirectTest extends \PHPUnit_Framework_TestCase
25
25
/**
26
26
* @var \PHPUnit_Framework_MockObject_MockObject|WriteInterface
27
27
*/
28
- protected $ writeDir ;
28
+ protected $ staticDir ;
29
29
30
30
/**
31
31
* @var \PHPUnit_Framework_MockObject_MockObject|WriteInterface
@@ -41,12 +41,12 @@ protected function setUp()
41
41
{
42
42
$ this ->cssUrlResolver = $ this ->getMock (\Magento \Framework \View \Url \CssResolver::class);
43
43
$ filesystem = $ this ->getMock (\Magento \Framework \Filesystem::class, [], [], '' , false );
44
- $ this ->writeDir = $ this ->getMockBuilder (WriteInterface::class)->getMockForAbstractClass ();
44
+ $ this ->staticDir = $ this ->getMockBuilder (WriteInterface::class)->getMockForAbstractClass ();
45
45
$ this ->tmpDir = $ this ->getMockBuilder (WriteInterface::class)->getMockForAbstractClass ();
46
46
$ filesystem ->expects ($ this ->any ())
47
47
->method ('getDirectoryWrite ' )
48
48
->willReturnMap ([
49
- [DirectoryList::STATIC_VIEW , \Magento \Framework \Filesystem \DriverPool::FILE , $ this ->writeDir ],
49
+ [DirectoryList::STATIC_VIEW , \Magento \Framework \Filesystem \DriverPool::FILE , $ this ->staticDir ],
50
50
[DirectoryList::TMP , \Magento \Framework \Filesystem \DriverPool::FILE , $ this ->tmpDir ],
51
51
]);
52
52
$ this ->resultAsset = $ this ->getMock (\Magento \Framework \View \Asset \File::class, [], [], '' , false );
@@ -56,19 +56,19 @@ protected function setUp()
56
56
public function testMergeNoAssets ()
57
57
{
58
58
$ this ->resultAsset ->expects ($ this ->once ())->method ('getPath ' )->will ($ this ->returnValue ('foo/result ' ));
59
- $ this ->writeDir ->expects ($ this ->never ())->method ('writeFile ' );
59
+ $ this ->staticDir ->expects ($ this ->never ())->method ('writeFile ' );
60
60
$ this ->tmpDir ->expects ($ this ->once ())->method ('writeFile ' )->with ('foo/result ' , '' );
61
- $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->writeDir );
61
+ $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->staticDir );
62
62
$ this ->object ->merge ([], $ this ->resultAsset );
63
63
}
64
64
65
65
public function testMergeGeneric ()
66
66
{
67
67
$ this ->resultAsset ->expects ($ this ->once ())->method ('getPath ' )->will ($ this ->returnValue ('foo/result ' ));
68
68
$ assets = $ this ->prepareAssetsToMerge ([' one ' , 'two ' ]); // note leading space intentionally
69
- $ this ->writeDir ->expects ($ this ->never ())->method ('writeFile ' );
69
+ $ this ->staticDir ->expects ($ this ->never ())->method ('writeFile ' );
70
70
$ this ->tmpDir ->expects ($ this ->once ())->method ('writeFile ' )->with ('foo/result ' , 'onetwo ' );
71
- $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->writeDir );
71
+ $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->staticDir );
72
72
$ this ->object ->merge ($ assets , $ this ->resultAsset );
73
73
}
74
74
@@ -86,9 +86,9 @@ public function testMergeCss()
86
86
->method ('aggregateImportDirectives ' )
87
87
->with ('12 ' )
88
88
->will ($ this ->returnValue ('1020 ' ));
89
- $ this ->writeDir ->expects ($ this ->never ())->method ('writeFile ' );
89
+ $ this ->staticDir ->expects ($ this ->never ())->method ('writeFile ' );
90
90
$ this ->tmpDir ->expects ($ this ->once ())->method ('writeFile ' )->with ('foo/result ' , '1020 ' );
91
- $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->writeDir );
91
+ $ this ->tmpDir ->expects ($ this ->once ())->method ('renameFile ' )->with ('foo/result ' , 'foo/result ' , $ this ->staticDir );
92
92
$ this ->object ->merge ($ assets , $ this ->resultAsset );
93
93
}
94
94
0 commit comments