From be9eef83b48278eb8a3c569a3fa60a34048a8d75 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 20 Sep 2014 13:45:35 +1200 Subject: [PATCH] Add tests for getLanguage() --- tests/DocumentationViewerTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/DocumentationViewerTest.php b/tests/DocumentationViewerTest.php index 4c7aafc..1c9edee 100755 --- a/tests/DocumentationViewerTest.php +++ b/tests/DocumentationViewerTest.php @@ -168,7 +168,15 @@ class DocumentationViewerTest extends FunctionalTest { } + public function testGetLanguage() { + $v = new DocumentationViewer(); + $response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/2.3/'), DataModel::inst()); + $this->assertEquals('en', $v->getLanguage()); + + $response = $v->handleRequest(new SS_HTTPRequest('GET', 'en/doc_test/2.3/subfolder/subsubfolder/subsubpage/'), DataModel::inst()); + $this->assertEquals('en', $v->getLanguage()); + } public function testAccessingAll() {