Skip to content

Commit 0905501

Browse files
author
Bohdan Korablov
committed
MAGETWO-38857: Decrease crap
1 parent f7cc893 commit 0905501

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
26
namespace Magento\Cms\Test\Unit\Model\Wysiwyg\Images;
37

48
use Magento\Framework\App\Filesystem\DirectoryList;
59
use Magento\Cms\Model\Wysiwyg\Images\Storage\Collection as StorageCollection;
610

711
/**
8-
* Copyright © 2015 Magento. All rights reserved.
9-
* See COPYING.txt for license details.
10-
*
1112
* @SuppressWarnings(PHPMD.LongVariable)
1213
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1314
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -24,7 +25,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase
2425
/**
2526
* @var \Magento\Cms\Model\Wysiwyg\Images\Storage
2627
*/
27-
protected $model = null;
28+
protected $imagesStorage;
2829

2930
/**
3031
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -228,7 +229,7 @@ protected function setUp()
228229

229230
$this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
230231

231-
$this->model = $this->objectManagerHelper->getObject(
232+
$this->imagesStorage = $this->objectManagerHelper->getObject(
232233
'Magento\Cms\Model\Wysiwyg\Images\Storage',
233234
[
234235
'session' => $this->sessionMock,
@@ -257,15 +258,15 @@ protected function setUp()
257258
*/
258259
public function testGetResizeWidth()
259260
{
260-
$this->assertEquals(100, $this->model->getResizeWidth());
261+
$this->assertEquals(100, $this->imagesStorage->getResizeWidth());
261262
}
262263

263264
/**
264265
* @covers \Magento\Cms\Model\Wysiwyg\Images\Storage::getResizeHeight
265266
*/
266267
public function testGetResizeHeight()
267268
{
268-
$this->assertEquals(50, $this->model->getResizeHeight());
269+
$this->assertEquals(50, $this->imagesStorage->getResizeHeight());
269270
}
270271

271272
/**
@@ -277,7 +278,7 @@ public function testDeleteDirectoryOverRoot()
277278
'\Magento\Framework\Exception\LocalizedException',
278279
sprintf('Directory %s is not under storage root path.', self::INVALID_DIRECTORY_OVER_ROOT)
279280
);
280-
$this->model->deleteDirectory(self::INVALID_DIRECTORY_OVER_ROOT);
281+
$this->imagesStorage->deleteDirectory(self::INVALID_DIRECTORY_OVER_ROOT);
281282
}
282283

283284
/**
@@ -289,7 +290,7 @@ public function testDeleteRootDirectory()
289290
'\Magento\Framework\Exception\LocalizedException',
290291
sprintf('We can\'t delete root directory %s right now.', self::STORAGE_ROOT_DIR)
291292
);
292-
$this->model->deleteDirectory(self::STORAGE_ROOT_DIR);
293+
$this->imagesStorage->deleteDirectory(self::STORAGE_ROOT_DIR);
293294
}
294295

295296
public function testGetDirsCollectionCreateSubDirectories()
@@ -325,7 +326,7 @@ public function testGetDirsCollectionCreateSubDirectories()
325326
*/
326327
public function testGetDirsCollection($exclude, $include, $fileNames, $expectedRemoveKeys)
327328
{
328-
$this->model = $this->objectManagerHelper->getObject(
329+
$this->imagesStorage = $this->objectManagerHelper->getObject(
329330
'Magento\Cms\Model\Wysiwyg\Images\Storage',
330331
[
331332
'session' => $this->sessionMock,
@@ -450,6 +451,6 @@ protected function generalTestGetDirsCollection($path, $collectionArray = [], $e
450451
->method('create')
451452
->willReturn($storageCollectionMock);
452453

453-
$this->model->getDirsCollection($path);
454+
$this->imagesStorage->getDirsCollection($path);
454455
}
455456
}

0 commit comments

Comments
 (0)