Example #1
0
 public function testExecute()
 {
     $layout = $this->getMock('\\Magento\\Framework\\View\\LayoutInterface');
     $block = $this->getMockBuilder('Magento\\Bundle\\Block\\Adminhtml\\Catalog\\Product\\Edit\\Tab\\Bundle\\Option\\Search')->disableOriginalConstructor()->setMethods(['setIndex', 'setFirstShow', 'toHtml'])->getMock();
     $this->response->expects($this->once())->method('setBody')->willReturnSelf();
     $this->request->expects($this->once())->method('getParam')->with('index')->willReturn('index');
     $this->view->expects($this->once())->method('getLayout')->willReturn($layout);
     $layout->expects($this->once())->method('createBlock')->willReturn($block);
     $block->expects($this->once())->method('setIndex')->willReturnSelf();
     $block->expects($this->once())->method('setFirstShow')->with(true)->willReturnSelf();
     $block->expects($this->once())->method('toHtml')->willReturnSelf();
     $this->assertEquals($this->response, $this->controller->execute());
 }