3939 * @package Test\Route
4040 */
4141class RouterTest extends TestCase {
42- public function testGenerateConsecutively (): void {
42+ /** @var Router */
43+ private $ router ;
44+ protected function setUp (): void {
45+ parent ::setUp ();
4346 /** @var LoggerInterface $logger */
4447 $ logger = $ this ->createMock (LoggerInterface::class);
4548 $ logger ->method ('info ' )
@@ -48,20 +51,27 @@ function (string $message, array $data) {
4851 $ this ->fail ('Unexpected info log: ' .(string )($ data ['exception ' ] ?? $ message ));
4952 }
5053 );
51- $ router = new Router (
54+ $ this -> router = new Router (
5255 $ logger ,
5356 $ this ->createMock (IRequest::class),
5457 $ this ->createMock (IConfig::class),
5558 $ this ->createMock (IEventLogger::class),
5659 $ this ->createMock (ContainerInterface::class),
5760 );
61+ }
62+
63+ public function testHeartbeat (): void {
64+ $ this ->assertEquals ('/index.php/heartbeat ' , $ this ->router ->generate ('heartbeat ' ));
65+ }
66+
67+ public function testGenerateConsecutively (): void {
5868
59- $ this ->assertEquals ('/index.php/apps/files/ ' , $ router ->generate ('files.view.index ' ));
69+ $ this ->assertEquals ('/index.php/apps/files/ ' , $ this -> router ->generate ('files.view.index ' ));
6070
6171 // the OCS route is the prefixed one for the AppFramework - see /ocs/v1.php for routing details
62- $ this ->assertEquals ('/index.php/ocsapp/apps/dav/api/v1/direct ' , $ router ->generate ('ocs.dav.direct.getUrl ' ));
72+ $ this ->assertEquals ('/index.php/ocsapp/apps/dav/api/v1/direct ' , $ this -> router ->generate ('ocs.dav.direct.getUrl ' ));
6373
6474 // test caching
65- $ this ->assertEquals ('/index.php/apps/files/ ' , $ router ->generate ('files.view.index ' ));
75+ $ this ->assertEquals ('/index.php/apps/files/ ' , $ this -> router ->generate ('files.view.index ' ));
6676 }
6777}
0 commit comments