summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-08 17:26:20 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-08 17:26:20 +0200
commitc79c894dbb6bda06ff32db4418b8fe6af5b27d4a (patch)
tree8291661d30277963db03424d6d84d4e31ffbf837 /tests
parenta92d6f3c50abc71bc02d2ddb0ae8896e9bf438c6 (diff)
parentecc9b42e4143773e4a850d6ee385328b16cda813 (diff)
downloadnextcloud-server-c79c894dbb6bda06ff32db4418b8fe6af5b27d4a.tar.gz
nextcloud-server-c79c894dbb6bda06ff32db4418b8fe6af5b27d4a.zip
Merge pull request #10755 from owncloud/shorter_sharing_links
Shorter sharing links
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/helper.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 20b8571b91d..cb342e295ba 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -443,15 +443,33 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
public function testLinkToPublic() {
\OC::$WEBROOT = '';
$result = \OC_Helper::linkToPublic('files');
- $this->assertEquals('http://localhost/public.php?service=files', $result);
+ $this->assertEquals('http://localhost/s', $result);
$result = \OC_Helper::linkToPublic('files', false);
- $this->assertEquals('http://localhost/public.php?service=files', $result);
+ $this->assertEquals('http://localhost/s', $result);
+ $result = \OC_Helper::linkToPublic('files', true);
+ $this->assertEquals('http://localhost/s/', $result);
+
+ $result = \OC_Helper::linkToPublic('other');
+ $this->assertEquals('http://localhost/public.php?service=other', $result);
+ $result = \OC_Helper::linkToPublic('other', false);
+ $this->assertEquals('http://localhost/public.php?service=other', $result);
+ $result = \OC_Helper::linkToPublic('other', true);
+ $this->assertEquals('http://localhost/public.php?service=other/', $result);
\OC::$WEBROOT = '/owncloud';
$result = \OC_Helper::linkToPublic('files');
- $this->assertEquals('http://localhost/owncloud/public.php?service=files', $result);
+ $this->assertEquals('http://localhost/owncloud/s', $result);
$result = \OC_Helper::linkToPublic('files', false);
- $this->assertEquals('http://localhost/owncloud/public.php?service=files', $result);
+ $this->assertEquals('http://localhost/owncloud/s', $result);
+ $result = \OC_Helper::linkToPublic('files', true);
+ $this->assertEquals('http://localhost/owncloud/s/', $result);
+
+ $result = \OC_Helper::linkToPublic('other');
+ $this->assertEquals('http://localhost/owncloud/public.php?service=other', $result);
+ $result = \OC_Helper::linkToPublic('other', false);
+ $this->assertEquals('http://localhost/owncloud/public.php?service=other', $result);
+ $result = \OC_Helper::linkToPublic('other', true);
+ $this->assertEquals('http://localhost/owncloud/public.php?service=other/', $result);
}
/**