27 $this->objectManager = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
28 $this->view = $this->createMock(\
Magento\Framework\
App\ViewInterface::class);
29 $this->storageHelper = $this->createMock(\
Magento\Theme\Helper\Storage::class);
30 $this->response = $this->createPartialMock(\
Magento\Framework\
App\
Response\Http::class, [
'setBody']);
32 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
33 $this->controller =
$helper->getObject(
34 \
Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files\OnInsert::class,
36 'objectManager' => $this->objectManager,
37 'view' => $this->view,
38 'response' => $this->response
45 $this->objectManager->expects($this->once())
47 ->with(\
Magento\Theme\Helper\Storage::class)
48 ->willReturn($this->storageHelper);
50 ->expects($this->once())
51 ->method(
'getRelativeUrl')
52 ->willReturn(
'http://relative.url/');
53 $this->response->expects($this->once())
55 ->with(
'http://relative.url/');
57 $this->controller->execute();