Remove deprecated OC_Helper::linkTo function
This commit is contained in:
parent
19eeb23b91
commit
205c239eab
|
@ -66,21 +66,6 @@ class OC_Helper {
|
||||||
return OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
|
return OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an url
|
|
||||||
* @param string $app app
|
|
||||||
* @param string $file file
|
|
||||||
* @param array $args array with param=>value, will be appended to the returned url
|
|
||||||
* The value of $args will be urlencoded
|
|
||||||
* @return string the url
|
|
||||||
* @deprecated Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
|
|
||||||
*
|
|
||||||
* Returns a url to the given app and file.
|
|
||||||
*/
|
|
||||||
public static function linkTo( $app, $file, $args = array() ) {
|
|
||||||
return OC::$server->getURLGenerator()->linkTo($app, $file, $args);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an absolute url
|
* Creates an absolute url
|
||||||
* @param string $app app
|
* @param string $app app
|
||||||
|
|
|
@ -294,52 +294,6 @@ class Test_Helper extends \Test\TestCase {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @small
|
|
||||||
* test linkTo URL construction
|
|
||||||
* @dataProvider provideDocRootAppUrlParts
|
|
||||||
*/
|
|
||||||
public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
|
|
||||||
\OC::$WEBROOT = '';
|
|
||||||
$result = \OC_Helper::linkTo($app, $file, $args);
|
|
||||||
|
|
||||||
$this->assertEquals($expectedResult, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @small
|
|
||||||
* test linkTo URL construction in sub directory
|
|
||||||
* @dataProvider provideSubDirAppUrlParts
|
|
||||||
*/
|
|
||||||
public function testLinkToSubDir($app, $file, $args, $expectedResult) {
|
|
||||||
\OC::$WEBROOT = '/owncloud';
|
|
||||||
$result = \OC_Helper::linkTo($app, $file, $args);
|
|
||||||
|
|
||||||
$this->assertEquals($expectedResult, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function provideDocRootAppUrlParts() {
|
|
||||||
return array(
|
|
||||||
array('files', 'ajax/list.php', array(), '/index.php/apps/files/ajax/list.php'),
|
|
||||||
array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'),
|
|
||||||
array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php?trut=trat&dut=dat'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function provideSubDirAppUrlParts() {
|
|
||||||
return array(
|
|
||||||
array('files', 'ajax/list.php', array(), '/owncloud/index.php/apps/files/ajax/list.php'),
|
|
||||||
array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'),
|
|
||||||
array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php?trut=trat&dut=dat'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @small
|
* @small
|
||||||
* test linkToAbsolute URL construction
|
* test linkToAbsolute URL construction
|
||||||
|
|
Loading…
Reference in New Issue