diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-10-09 20:50:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 20:50:37 +0200 |
commit | a9f4817b652b636a3b2f8c11b2a3e7526e0be82d (patch) | |
tree | 821152e474441aa59c8f4f476bdf91d8e4601fa0 /tests/lib/UrlGeneratorTest.php | |
parent | ab3599155f9b51cc17fca188f48269aeb44f9462 (diff) | |
parent | c97b4274ccdc4fa841b164dedb608fdf351a0412 (diff) | |
download | nextcloud-server-a9f4817b652b636a3b2f8c11b2a3e7526e0be82d.tar.gz nextcloud-server-a9f4817b652b636a3b2f8c11b2a3e7526e0be82d.zip |
Merge pull request #11622 from nextcloud/feature/11617
Add function to generate urls for OCS routes
Diffstat (limited to 'tests/lib/UrlGeneratorTest.php')
-rw-r--r-- | tests/lib/UrlGeneratorTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php index 340c9c7082d..0e50f4d92ec 100644 --- a/tests/lib/UrlGeneratorTest.php +++ b/tests/lib/UrlGeneratorTest.php @@ -162,4 +162,22 @@ class UrlGeneratorTest extends \Test\TestCase { $this->assertEquals($expected, $actual); } + /** + * @dataProvider provideOCSRoutes + */ + public function testLinkToOCSRouteAbsolute(string $route, string $expected) { + $this->mockBaseUrl(); + \OC::$WEBROOT = '/nextcloud'; + $result = $this->urlGenerator->linkToOCSRouteAbsolute($route); + $this->assertEquals($expected, $result); + } + + public function provideOCSRoutes() { + return [ + ['core.OCS.getCapabilities', 'http://localhost/nextcloud/ocs/v2.php/cloud/capabilities'], + ['core.WhatsNew.dismiss', 'http://localhost/nextcloud/ocs/v2.php/core/whatsnew'], + ]; + } + + } |