function testUrlParsing() { // Module index $v = new DocumentationViewer(); $response = $v->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/2.3/test')); $this->assertEquals('2.3', $v->getVersion()); $this->assertEquals('en', $v->getLang()); $this->assertEquals('DocumentationViewerTests', $v->getEntity()->getTitle()); $this->assertEquals(array('test'), $v->Remaining); // Module index without version and language. Should pick up the defaults $v2 = new DocumentationViewer(); $response = $v2->handleRequest(new SS_HTTPRequest('GET', 'DocumentationViewerTests/en/test')); $this->assertEquals('2.4', $v2->getVersion()); $this->assertEquals('en', $v2->getLang()); $this->assertEquals('DocumentationViewerTests', $v2->getEntity()->getTitle()); $this->assertEquals(array('test'), $v2->Remaining); // Overall index $v = new DocumentationViewer(); $response = $v->handleRequest(new SS_HTTPRequest('GET', '')); $this->assertEquals('', $v->getVersion()); $this->assertEquals('en', $v->getLang()); $this->assertEquals('', $v->module); $this->assertEquals(array(), $v->Remaining); }