Example #1
0
 public function testCopyQuoteToOrder()
 {
     $optionMock = $this->getMockBuilder('Magento\\Catalog\\Model\\Product\\Configuration\\Item\\Option\\OptionInterface')->disableOriginalConstructor()->setMethods(['getValue'])->getMockForAbstractClass();
     $quotePath = '/quote/path/path/uploaded.file';
     $orderPath = '/order/path/path/uploaded.file';
     $optionMock->expects($this->any())->method('getValue')->will($this->returnValue(['quote_path' => $quotePath, 'order_path' => $orderPath]));
     $this->rootDirectory->expects($this->any())->method('isFile')->with($this->equalTo($quotePath))->will($this->returnValue(true));
     $this->rootDirectory->expects($this->any())->method('isReadable')->with($this->equalTo($quotePath))->will($this->returnValue(true));
     $this->rootDirectory->expects($this->any())->method('getAbsolutePath')->will($this->returnValue('/file.path'));
     $this->coreFileStorageDatabase->expects($this->any())->method('copyFile')->will($this->returnValue('true'));
     $fileObject = $this->getFileObject();
     $fileObject->setData('configuration_item_option', $optionMock);
     $this->assertInstanceOf('Magento\\Catalog\\Model\\Product\\Option\\Type\\File', $fileObject->copyQuoteToOrder());
 }
Example #2
0
 public function testClearCache()
 {
     $this->coreFileHelper->expects($this->once())->method('deleteFolder')->will($this->returnValue(true));
     $this->image->clearCache();
 }