3939 * @package Test\Route
4040 */
4141class RouterTest extends TestCase {
42- public function testGenerateConsecutively (): void {
42+ private Router $ router ;
43+ protected function setUp (): void {
44+ parent ::setUp ();
4345 /** @var LoggerInterface $logger */
4446 $ logger = $ this ->createMock (LoggerInterface::class);
4547 $ logger ->method ('info ' )
@@ -48,20 +50,27 @@ function (string $message, array $data) {
4850 $ this ->fail ('Unexpected info log: ' .(string )($ data ['exception ' ] ?? $ message ));
4951 }
5052 );
51- $ router = new Router (
53+ $ this -> router = new Router (
5254 $ logger ,
5355 $ this ->createMock (IRequest::class),
5456 $ this ->createMock (IConfig::class),
5557 $ this ->createMock (IEventLogger::class),
5658 $ this ->createMock (ContainerInterface::class),
5759 );
60+ }
61+
62+ public function testHeartbeat (): void {
63+ $ this ->assertEquals ('/index.php/heartbeat ' , $ this ->router ->generate ('heartbeat ' ));
64+ }
65+
66+ public function testGenerateConsecutively (): void {
5867
59- $ this ->assertEquals ('/index.php/apps/files/ ' , $ router ->generate ('files.view.index ' ));
68+ $ this ->assertEquals ('/index.php/apps/files/ ' , $ this -> router ->generate ('files.view.index ' ));
6069
6170 // 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 ' ));
71+ $ this ->assertEquals ('/index.php/ocsapp/apps/dav/api/v1/direct ' , $ this -> router ->generate ('ocs.dav.direct.getUrl ' ));
6372
6473 // test caching
65- $ this ->assertEquals ('/index.php/apps/files/ ' , $ router ->generate ('files.view.index ' ));
74+ $ this ->assertEquals ('/index.php/apps/files/ ' , $ this -> router ->generate ('files.view.index ' ));
6675 }
6776}
0 commit comments