Skip to content

Commit 00dd57d

Browse files
committed
Update product file option test to match File class better. It should still test mediaDirectory->copyFile().
1 parent 90dbee1 commit 00dd57d

File tree

1 file changed

+9
-9
lines changed
  • app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type

1 file changed

+9
-9
lines changed

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type/FileTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
99
use Magento\Framework\App\Filesystem\DirectoryList;
1010
use Magento\Framework\Filesystem;
11-
use Magento\Framework\Filesystem\Directory\ReadInterface;
11+
use Magento\Framework\Filesystem\Directory\WriteInterface;
1212
use Magento\Framework\Filesystem\DriverPool;
1313

1414
/**
@@ -24,9 +24,9 @@ class FileTest extends \PHPUnit_Framework_TestCase
2424
protected $objectManager;
2525

2626
/**
27-
* @var ReadInterface|\PHPUnit_Framework_MockObject_MockObject
27+
* @var WriteInterface|\PHPUnit_Framework_MockObject_MockObject
2828
*/
29-
protected $rootDirectory;
29+
protected $mediaDirectory;
3030

3131
/**
3232
* @var \Magento\MediaStorage\Helper\File\Storage\Database|\PHPUnit_Framework_MockObject_MockObject
@@ -61,13 +61,13 @@ protected function setUp()
6161
->disableOriginalConstructor()
6262
->getMock();
6363

64-
$this->rootDirectory = $this->getMockBuilder(ReadInterface::class)
64+
$this->mediaDirectory = $this->getMockBuilder(WriteInterface::class)
6565
->getMock();
6666

6767
$this->filesystemMock->expects($this->any())
68-
->method('getDirectoryRead')
68+
->method('getDirectoryWrite')
6969
->with(DirectoryList::MEDIA, DriverPool::FILE)
70-
->willReturn($this->rootDirectory);
70+
->willReturn($this->mediaDirectory);
7171

7272
$this->serializer = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)
7373
->disableOriginalConstructor()
@@ -158,17 +158,17 @@ function ($value) {
158158
->method('getValue')
159159
->will($this->returnValue($quoteValue));
160160

161-
$this->rootDirectory->expects($this->any())
161+
$this->mediaDirectory->expects($this->any())
162162
->method('isFile')
163163
->with($this->equalTo($quotePath))
164164
->will($this->returnValue(true));
165165

166-
$this->rootDirectory->expects($this->any())
166+
$this->mediaDirectory->expects($this->any())
167167
->method('isReadable')
168168
->with($this->equalTo($quotePath))
169169
->will($this->returnValue(true));
170170

171-
$this->rootDirectory->expects($this->any())
171+
$this->mediaDirectory->expects($this->any())
172172
->method('getAbsolutePath')
173173
->will($this->returnValue('/file.path'));
174174

0 commit comments

Comments
 (0)