File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,30 @@ public function testGet()
5656 $ this ->assertSame ('foo ' , $ router ->run ());
5757 }
5858
59+ /**
60+ * @covers OpCacheGUI\Network\Router::__construct
61+ * @covers OpCacheGUI\Network\Router::run
62+ * @covers OpCacheGUI\Network\Router::getMainPage
63+ */
64+ public function testRunNoRoutes ()
65+ {
66+ $ requestMock = $ this ->getMock ('\\OpCacheGUI \\Network \\RequestData ' );
67+ $ requestMock ->method ('getVerb ' )->willReturn ('GET ' );
68+ $ requestMock ->method ('path ' )->willReturn ('somepath ' );
69+
70+ //$routeMock = $this->getMockBuilder('\\OpCacheGUI\\Network\\Route')->disableOriginalConstructor()->getMock();
71+ //$routeMock->method('matchesRequest')->will($this->onConsecutiveCalls(false, true));
72+ //$routeMock->method('run')->willReturn('main route');
73+
74+ $ factoryMock = $ this ->getMock ('\\OpCacheGUI \\Network \\RouteBuilder ' );
75+ //$factoryMock->method('build')->willReturn($routeMock);
76+
77+ $ router = new Router ($ requestMock , $ factoryMock );
78+ //$router->get('id', function () {});
79+
80+ $ this ->assertNull ($ router ->run ());
81+ }
82+
5983 /**
6084 * @covers OpCacheGUI\Network\Router::__construct
6185 * @covers OpCacheGUI\Network\Router::run
You can’t perform that action at this time.
0 commit comments