/** * @param int $storage * @param int $callNum * @dataProvider updateFileDataProvider */ public function testRenameFile($storage, $callNum) { $this->configMock->expects($this->once())->method('getValue')->with(\Magento\Core\Model\File\Storage::XML_PATH_STORAGE_MEDIA, 'default')->will($this->returnValue($storage)); $dbModelMock = $this->getMockBuilder('Magento\\Core\\Model\\File\\Storage\\Database')->disableOriginalConstructor()->getMock(); $this->dbStorageFactoryMock->expects($this->exactly($callNum))->method('create')->will($this->returnValue($dbModelMock)); $dbModelMock->expects($this->exactly($callNum))->method('renameFile')->with('oldName', 'newName'); $this->helper->renameFile('media-dir/oldName', 'media-dir/newName'); }