/**
  * 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();
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }