send( $this->request('GET', '/custom') ); $this->assertEquals(404, $response->getStatusCode()); } /** * @test */ public function custom_route_can_be_added_by_extender() { $this->extend( (new Extend\Routes('forum')) ->get('/custom', 'custom', CustomRoute::class) ); $response = $this->send( $this->request('GET', '/custom') ); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('Hello Flarumites!', $response->getBody()); } } class CustomRoute implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new TextResponse('Hello Flarumites!'); } }