public function testExecuteValidPost() { $post = ['name' => 'Name', 'comment' => 'Comment', 'email' => '*****@*****.**', 'hideit' => null]; $this->_request->expects($this->any())->method('getPostValue')->will($this->returnValue($post)); $transport = $this->getMock('\\Magento\\Framework\\Mail\\TransportInterface', [], [], '', false); $this->_transportBuilder->expects($this->once())->method('setTemplateIdentifier')->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('setTemplateOptions')->with(['area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID])->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('setTemplateVars')->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('setFrom')->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('addTo')->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('setReplyTo')->with($post['email'])->will($this->returnSelf()); $this->_transportBuilder->expects($this->once())->method('getTransport')->will($this->returnValue($transport)); $transport->expects($this->once())->method('sendMessage'); $this->_inlineTranslation->expects($this->once())->method('resume'); $this->_inlineTranslation->expects($this->once())->method('suspend'); $this->_controller->executeInternal(); }
public function testExecute() { $this->_view->expects($this->once())->method('loadLayout'); $this->_view->expects($this->once())->method('renderLayout'); $this->_controller->executeInternal(); }