diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-08 17:12:44 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-08 17:12:44 +0200 |
commit | 3ad9489634186a13f43d40998af7b5dee1ef6c44 (patch) | |
tree | b49912aae664b87b62c2f11b0062eb683f5ba4b3 /tests/lib/urlgenerator.php | |
parent | c5b53785583eb215eb1ec889333ecf25ecb97e66 (diff) | |
download | nextcloud-server-3ad9489634186a13f43d40998af7b5dee1ef6c44.tar.gz nextcloud-server-3ad9489634186a13f43d40998af7b5dee1ef6c44.zip |
Add unit test
This unit test is shitty but at least it works...
Diffstat (limited to 'tests/lib/urlgenerator.php')
-rw-r--r-- | tests/lib/urlgenerator.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/urlgenerator.php b/tests/lib/urlgenerator.php index 888512ee426..066272731ee 100644 --- a/tests/lib/urlgenerator.php +++ b/tests/lib/urlgenerator.php @@ -36,6 +36,25 @@ class Test_Urlgenerator extends PHPUnit_Framework_TestCase { $this->assertEquals($expectedResult, $result); } + /** + * @dataProvider provideRoutes + */ + public function testLinkToRouteAbsolute($route, $expected) { + \OC::$WEBROOT = '/owncloud'; + $config = $this->getMock('\OCP\IConfig'); + $urlGenerator = new \OC\URLGenerator($config); + $result = $urlGenerator->linkToRouteAbsolute($route); + $this->assertEquals($expected, $result); + + } + + public function provideRoutes() { + return array( + array('files_index', 'http://localhost/owncloud/index.php/apps/files/'), + array('core_ajax_preview', 'http://localhost/owncloud/index.php/core/preview.png'), + ); + } + public function provideDocRootAppUrlParts() { return array( array('files', 'index.php', array(), '/index.php/apps/files'), |