@@ -22,80 +22,80 @@ class FileTest extends TestCase
2222 /**
2323 * @var File
2424 */
25- protected $ _file ;
25+ private $ file ;
2626
2727 /**
2828 * @var Media
2929 */
30- protected $ _loggerMock ;
30+ private $ loggerMock ;
3131
3232 /**
3333 * @var Database
3434 */
35- protected $ _storageHelperMock ;
35+ private $ storageHelperMock ;
3636
3737 /**
3838 * @var DateTime
3939 */
40- protected $ _mediaHelperMock ;
40+ private $ mediaHelperMock ;
4141
4242 /**
4343 * @var \Magento\MediaStorage\Model\ResourceModel\File\Storage\File
4444 */
45- protected $ _fileUtilityMock ;
45+ private $ fileUtilityMock ;
4646
4747 protected function setUp (): void
4848 {
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);
5353
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
5959 );
6060 }
6161
6262 protected function tearDown (): void
6363 {
64- unset($ this ->_file );
64+ unset($ this ->file );
6565 }
6666
6767 public function testSaveFileWithWrongFileFormat (): void
6868 {
6969 $ this ->expectException (LocalizedException::class);
7070 $ this ->expectExceptionMessage ('Wrong file info format ' );
71- $ this ->_file ->saveFile ([]);
71+ $ this ->file ->saveFile ([]);
7272 }
7373
74- public function testSaveFileUnsuccessfullyWithMissingDirectory ()
74+ public function testSaveFileUnsuccessfullyWithMissingDirectory (): void
7575 {
76- $ this ->_fileUtilityMock
76+ $ this ->fileUtilityMock
7777 ->expects ($ this ->once ())
7878 ->method ('saveFile ' )
7979 ->willThrowException (new Exception ());
8080
8181 $ this ->expectException (LocalizedException::class);
8282 $ this ->expectExceptionMessage ('Unable to save file "filename.ext" at "filename.ext" ' );
83- $ this ->_file ->saveFile ([
83+ $ this ->file ->saveFile ([
8484 'filename ' => 'filename.ext ' ,
8585 'content ' => 'content ' ,
8686 ]);
8787 }
8888
89- public function testSaveFileUnsuccessfullyWithoutMissingDirectory ()
89+ public function testSaveFileUnsuccessfullyWithoutMissingDirectory (): void
9090 {
91- $ this ->_fileUtilityMock
91+ $ this ->fileUtilityMock
9292 ->expects ($ this ->once ())
9393 ->method ('saveFile ' )
9494 ->willThrowException (new Exception ());
9595
9696 $ this ->expectException (LocalizedException::class);
9797 $ this ->expectExceptionMessage ('Unable to save file "filename.ext" at "directory/filename.ext" ' );
98- $ this ->_file ->saveFile ([
98+ $ this ->file ->saveFile ([
9999 'directory ' => 'directory ' ,
100100 'filename ' => 'filename.ext ' ,
101101 'content ' => 'content ' ,
0 commit comments