@@ -28,6 +28,21 @@ public function setUp()
28
28
{
29
29
$ this ->maintenanceMode = $ this ->getMock ('Magento\Framework\App\MaintenanceMode ' , [], [], '' , false );
30
30
$ this ->controller = new Maintenance ($ this ->maintenanceMode );
31
+
32
+ $ request = $ this ->getMock ('\Zend\Http\PhpEnvironment\Request ' , [], [], '' , false );
33
+ $ response = $ this ->getMock ('\Zend\Http\PhpEnvironment\Response ' , [], [], '' , false );
34
+ $ routeMatch = $ this ->getMock ('\Zend\Mvc\Router\RouteMatch ' , [], [], '' , false );
35
+
36
+ $ mvcEvent = $ this ->getMock ('\Zend\Mvc\MvcEvent ' , [], [], '' , false );
37
+ $ mvcEvent ->expects ($ this ->any ())->method ('setRequest ' )->with ($ request )->willReturn ($ mvcEvent );
38
+ $ mvcEvent ->expects ($ this ->any ())->method ('setResponse ' )->with ($ response )->willReturn ($ mvcEvent );
39
+ $ mvcEvent ->expects ($ this ->any ())->method ('setTarget ' )->with ($ this ->controller )->willReturn ($ mvcEvent );
40
+ $ mvcEvent ->expects ($ this ->any ())->method ('getRouteMatch ' )->willReturn ($ routeMatch );
41
+ $ contentArray = '{"disable":false} ' ;
42
+ $ request ->expects ($ this ->any ())->method ('getContent ' )->willReturn ($ contentArray );
43
+
44
+ $ this ->controller ->setEvent ($ mvcEvent );
45
+ $ this ->controller ->dispatch ($ request , $ response );
31
46
}
32
47
33
48
public function testIndexAction ()
0 commit comments