public function unregisterPageHandler($identifier) { unset($this->handlers[$identifier]); }
function testCanUnregisterPageHandlers() { $this->router->registerPageHandler('hello', array($this, 'hello_page_handler')); $this->router->unregisterPageHandler('hello'); $request = \Elgg\Http\Request::create('http://localhost/hello/'); ob_start(); $handled = $this->router->route($request); $output = ob_get_clean(); // 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); }