/** * @small * test absolute URL construction * @dataProvider provideSubDirURLs */ function testGetAbsoluteURLSubDir($url, $expectedResult) { \OC::$WEBROOT = '/owncloud'; $urlGenerator = new \OC\URLGenerator(null); $result = $urlGenerator->getAbsoluteURL($url); $this->assertEquals($expectedResult, $result); }
/** * @small * test absolute URL construction * @dataProvider provideSubDirURLs */ function testGetAbsoluteURLSubDir($url, $expectedResult) { \OC::$WEBROOT = '/owncloud'; $config = $this->getMock('\\OCP\\IConfig'); $cacheFactory = $this->getMock('\\OCP\\ICacheFactory'); $urlGenerator = new \OC\URLGenerator($config, $cacheFactory); $result = $urlGenerator->getAbsoluteURL($url); $this->assertEquals($expectedResult, $result); }