1
1
<?php
2
+ /**
3
+ * Copyright © 2015 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
2
6
namespace Magento \Cms \Test \Unit \Model \Wysiwyg \Images ;
3
7
4
8
use Magento \Framework \App \Filesystem \DirectoryList ;
5
9
use Magento \Cms \Model \Wysiwyg \Images \Storage \Collection as StorageCollection ;
6
10
7
11
/**
8
- * Copyright © 2015 Magento. All rights reserved.
9
- * See COPYING.txt for license details.
10
- *
11
12
* @SuppressWarnings(PHPMD.LongVariable)
12
13
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13
14
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -24,7 +25,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase
24
25
/**
25
26
* @var \Magento\Cms\Model\Wysiwyg\Images\Storage
26
27
*/
27
- protected $ model = null ;
28
+ protected $ imagesStorage ;
28
29
29
30
/**
30
31
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -228,7 +229,7 @@ protected function setUp()
228
229
229
230
$ this ->objectManagerHelper = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
230
231
231
- $ this ->model = $ this ->objectManagerHelper ->getObject (
232
+ $ this ->imagesStorage = $ this ->objectManagerHelper ->getObject (
232
233
'Magento\Cms\Model\Wysiwyg\Images\Storage ' ,
233
234
[
234
235
'session ' => $ this ->sessionMock ,
@@ -257,15 +258,15 @@ protected function setUp()
257
258
*/
258
259
public function testGetResizeWidth ()
259
260
{
260
- $ this ->assertEquals (100 , $ this ->model ->getResizeWidth ());
261
+ $ this ->assertEquals (100 , $ this ->imagesStorage ->getResizeWidth ());
261
262
}
262
263
263
264
/**
264
265
* @covers \Magento\Cms\Model\Wysiwyg\Images\Storage::getResizeHeight
265
266
*/
266
267
public function testGetResizeHeight ()
267
268
{
268
- $ this ->assertEquals (50 , $ this ->model ->getResizeHeight ());
269
+ $ this ->assertEquals (50 , $ this ->imagesStorage ->getResizeHeight ());
269
270
}
270
271
271
272
/**
@@ -277,7 +278,7 @@ public function testDeleteDirectoryOverRoot()
277
278
'\Magento\Framework\Exception\LocalizedException ' ,
278
279
sprintf ('Directory %s is not under storage root path. ' , self ::INVALID_DIRECTORY_OVER_ROOT )
279
280
);
280
- $ this ->model ->deleteDirectory (self ::INVALID_DIRECTORY_OVER_ROOT );
281
+ $ this ->imagesStorage ->deleteDirectory (self ::INVALID_DIRECTORY_OVER_ROOT );
281
282
}
282
283
283
284
/**
@@ -289,7 +290,7 @@ public function testDeleteRootDirectory()
289
290
'\Magento\Framework\Exception\LocalizedException ' ,
290
291
sprintf ('We can \'t delete root directory %s right now. ' , self ::STORAGE_ROOT_DIR )
291
292
);
292
- $ this ->model ->deleteDirectory (self ::STORAGE_ROOT_DIR );
293
+ $ this ->imagesStorage ->deleteDirectory (self ::STORAGE_ROOT_DIR );
293
294
}
294
295
295
296
public function testGetDirsCollectionCreateSubDirectories ()
@@ -325,7 +326,7 @@ public function testGetDirsCollectionCreateSubDirectories()
325
326
*/
326
327
public function testGetDirsCollection ($ exclude , $ include , $ fileNames , $ expectedRemoveKeys )
327
328
{
328
- $ this ->model = $ this ->objectManagerHelper ->getObject (
329
+ $ this ->imagesStorage = $ this ->objectManagerHelper ->getObject (
329
330
'Magento\Cms\Model\Wysiwyg\Images\Storage ' ,
330
331
[
331
332
'session ' => $ this ->sessionMock ,
@@ -450,6 +451,6 @@ protected function generalTestGetDirsCollection($path, $collectionArray = [], $e
450
451
->method ('create ' )
451
452
->willReturn ($ storageCollectionMock );
452
453
453
- $ this ->model ->getDirsCollection ($ path );
454
+ $ this ->imagesStorage ->getDirsCollection ($ path );
454
455
}
455
456
}
0 commit comments