@@ -22,80 +22,80 @@ class FileTest extends TestCase
22
22
/**
23
23
* @var File
24
24
*/
25
- protected $ _file ;
25
+ private $ file ;
26
26
27
27
/**
28
28
* @var Media
29
29
*/
30
- protected $ _loggerMock ;
30
+ private $ loggerMock ;
31
31
32
32
/**
33
33
* @var Database
34
34
*/
35
- protected $ _storageHelperMock ;
35
+ private $ storageHelperMock ;
36
36
37
37
/**
38
38
* @var DateTime
39
39
*/
40
- protected $ _mediaHelperMock ;
40
+ private $ mediaHelperMock ;
41
41
42
42
/**
43
43
* @var \Magento\MediaStorage\Model\ResourceModel\File\Storage\File
44
44
*/
45
- protected $ _fileUtilityMock ;
45
+ private $ fileUtilityMock ;
46
46
47
47
protected function setUp (): void
48
48
{
49
- $ this ->_loggerMock = $ this ->getMockForAbstractClass (LoggerInterface::class);
50
- $ this ->_storageHelperMock = $ this ->createMock (Database::class);
51
- $ this ->_mediaHelperMock = $ this ->createMock (Media::class);
52
- $ this ->_fileUtilityMock = $ this ->createMock (\Magento \MediaStorage \Model \ResourceModel \File \Storage \File::class);
49
+ $ this ->loggerMock = $ this ->getMockForAbstractClass (LoggerInterface::class);
50
+ $ this ->storageHelperMock = $ this ->createMock (Database::class);
51
+ $ this ->mediaHelperMock = $ this ->createMock (Media::class);
52
+ $ this ->fileUtilityMock = $ this ->createMock (\Magento \MediaStorage \Model \ResourceModel \File \Storage \File::class);
53
53
54
- $ this ->_file = new File (
55
- $ this ->_loggerMock ,
56
- $ this ->_storageHelperMock ,
57
- $ this ->_mediaHelperMock ,
58
- $ this ->_fileUtilityMock
54
+ $ this ->file = new File (
55
+ $ this ->loggerMock ,
56
+ $ this ->storageHelperMock ,
57
+ $ this ->mediaHelperMock ,
58
+ $ this ->fileUtilityMock
59
59
);
60
60
}
61
61
62
62
protected function tearDown (): void
63
63
{
64
- unset($ this ->_file );
64
+ unset($ this ->file );
65
65
}
66
66
67
67
public function testSaveFileWithWrongFileFormat (): void
68
68
{
69
69
$ this ->expectException (LocalizedException::class);
70
70
$ this ->expectExceptionMessage ('Wrong file info format ' );
71
- $ this ->_file ->saveFile ([]);
71
+ $ this ->file ->saveFile ([]);
72
72
}
73
73
74
- public function testSaveFileUnsuccessfullyWithMissingDirectory ()
74
+ public function testSaveFileUnsuccessfullyWithMissingDirectory (): void
75
75
{
76
- $ this ->_fileUtilityMock
76
+ $ this ->fileUtilityMock
77
77
->expects ($ this ->once ())
78
78
->method ('saveFile ' )
79
79
->willThrowException (new Exception ());
80
80
81
81
$ this ->expectException (LocalizedException::class);
82
82
$ this ->expectExceptionMessage ('Unable to save file "filename.ext" at "filename.ext" ' );
83
- $ this ->_file ->saveFile ([
83
+ $ this ->file ->saveFile ([
84
84
'filename ' => 'filename.ext ' ,
85
85
'content ' => 'content ' ,
86
86
]);
87
87
}
88
88
89
- public function testSaveFileUnsuccessfullyWithoutMissingDirectory ()
89
+ public function testSaveFileUnsuccessfullyWithoutMissingDirectory (): void
90
90
{
91
- $ this ->_fileUtilityMock
91
+ $ this ->fileUtilityMock
92
92
->expects ($ this ->once ())
93
93
->method ('saveFile ' )
94
94
->willThrowException (new Exception ());
95
95
96
96
$ this ->expectException (LocalizedException::class);
97
97
$ this ->expectExceptionMessage ('Unable to save file "filename.ext" at "directory/filename.ext" ' );
98
- $ this ->_file ->saveFile ([
98
+ $ this ->file ->saveFile ([
99
99
'directory ' => 'directory ' ,
100
100
'filename ' => 'filename.ext ' ,
101
101
'content ' => 'content ' ,
0 commit comments