/**
  * Save file to storage
  *
  * @param  array $result
  * @return $this
  */
 protected function _afterSave($result)
 {
     if (empty($result['path']) || empty($result['file'])) {
         return $this;
     }
     if ($this->_coreFileStorage->isInternalStorage() || $this->skipDbProcessing()) {
         return $this;
     }
     $this->_result['file'] = $this->_coreFileStorageDb->saveUploadedFile($result);
     return $this;
 }
 /**
  * @param int $storage
  * @param int $callNum
  * @param bool $expected
  * @dataProvider isInternalStorageDataProvider
  */
 public function testIsInternalStorage($storage, $callNum, $expected)
 {
     $currentStorage = '10';
     $this->configMock->expects($this->exactly($callNum))->method('getValue')->with(\Magento\MediaStorage\Model\File\Storage::XML_PATH_STORAGE_MEDIA, 'default')->will($this->returnValue($currentStorage));
     $this->assertEquals($expected, $this->helper->isInternalStorage($storage));
 }