function testCanUnregisterPageHandlers() { $this->router->registerPageHandler('hello', array($this, 'hello_page_handler')); $this->router->unregisterPageHandler('hello'); ob_start(); $this->router->route($this->prepareHttpRequest('hello')); $output = ob_get_clean(); $response = _elgg_services()->responseFactory->getSentResponse(); $this->assertFalse($response); // Normally we would expect the router to return false for this request, // but since it checks for headers_sent() and PHPUnit issues output before // this test runs, the headers have already been sent. It's enough to verify // that the output we buffered is empty. // $this->assertFalse($handled); $this->assertEmpty($output); }