コード例 #1
0
 /**
  * Test execute()
  */
 public function testExecute()
 {
     $this->request->expects($this->any())->method('getParam')->will($this->returnValueMap(['remote_image' => 'https://pp.vk.me/c304605/v304605289/3ff9/s4rpaW_TZ6A.jpg']));
     $readInterface = $this->getMock('\\Magento\\Framework\\Filesystem\\Directory\\ReadInterface', [], [], '', false);
     $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface);
     $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn('/var/www/application/sample.jpg');
     $this->abstractAdapter->expects($this->any())->method('validateUploadFile')->willReturn('true');
     $this->image->execute();
 }