public function testEmptyFile() { $this->prepareEnvForEmptyFile(); $this->setExpectedException('\\Magento\\Framework\\Exception\\LocalizedException', 'The file is empty. Please choose another one'); $httpAdapterMock = $this->getMock('Zend_File_Transfer_Adapter_Http', ['isValid']); $httpAdapterMock->expects($this->once())->method('isValid')->will($this->returnValue(true)); $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock)); $this->model->validate($this->objectManager->create('Magento\\Framework\\DataObject'), $this->getProductOption()); }
/** * @return void */ public function testValidate() { $this->prepareEnv(); $httpAdapterMock = $this->getMock('Zend_File_Transfer_Adapter_Http', ['isValid']); $httpAdapterMock->expects($this->once())->method('isValid')->will($this->returnValue(true)); $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock)); $result = $this->model->validate($this->objectManager->create('Magento\\Framework\\Object'), $this->getProductOption()); unset($result['fullpath'], $result['secret_key']); $this->assertEquals($this->expectedValidate(), $result); }