32 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
33 $this->_requestMock = $this->createMock(\
Magento\Framework\
App\Request\Http::class);
34 $this->_viewMock = $this->createMock(\
Magento\Framework\
App\ViewInterface::class);
36 $this->createPartialMock(\
Magento\Framework\DataObject::class, [
'getLoaded',
'getForwarded']);
37 $this->_controller =
$helper->getObject(
38 \
Magento\Framework\Controller\Noroute\Index::class,
39 [
'request' => $this->_requestMock,
'view' => $this->_viewMock]
45 $this->_requestMock->expects(
52 $this->returnValue($this->_statusMock)
54 $this->_statusMock->expects($this->any())->method(
'getLoaded')->will($this->returnValue(
false));
55 $this->_viewMock->expects($this->once())->method(
'loadLayout')->with([
'default',
'noroute']);
56 $this->_viewMock->expects($this->once())->method(
'renderLayout');
57 $this->_controller->execute();
62 $this->_requestMock->expects(
69 $this->returnValue($this->_statusMock)
71 $this->_statusMock->expects($this->any())->method(
'getLoaded')->will($this->returnValue(
true));
72 $this->_statusMock->expects($this->any())->method(
'getForwarded')->will($this->returnValue(
false));
73 $this->_viewMock->expects($this->never())->method(
'loadLayout');
74 $this->_requestMock->expects(
79 $this->returnValue($this->_requestMock)
81 $this->_controller->execute();
86 $this->_requestMock->expects(
93 $this->returnValue(
'string')
95 $this->_controller->execute();
testIndexActionWhenStatusNotInstanceofMagentoObject()
testIndexActionWhenStatusLoaded()
testIndexActionWhenStatusNotLoaded()