Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
3d55569a
Commit
3d55569a
authored
Dec 18, 2015
by
Morris Jobke
Browse files
OC_Helper::makeURLAbsolute is not used anymore
parent
6a7dbf3c
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/private/helper.php
View file @
3d55569a
...
...
@@ -69,18 +69,6 @@ class OC_Helper {
);
}
/**
* Makes an $url absolute
* @param string $url the url
* @return string the absolute url
* @deprecated Use \OC::$server->getURLGenerator()->getAbsoluteURL($url)
*
* Returns a absolute url to the given app and file.
*/
public
static
function
makeURLAbsolute
(
$url
)
{
return
OC
::
$server
->
getURLGenerator
()
->
getAbsoluteURL
(
$url
);
}
/**
* Creates an url for remote use
* @param string $service id
...
...
tests/lib/helper.php
View file @
3d55569a
...
...
@@ -243,48 +243,6 @@ class Test_Helper extends \Test\TestCase {
// Url generator methods
/**
* @small
* test absolute URL construction
* @dataProvider provideDocRootURLs
*/
function
testMakeAbsoluteURLDocRoot
(
$url
,
$expectedResult
)
{
\
OC
::
$WEBROOT
=
''
;
$result
=
\
OC_Helper
::
makeURLAbsolute
(
$url
);
$this
->
assertEquals
(
$expectedResult
,
$result
);
}
/**
* @small
* test absolute URL construction
* @dataProvider provideSubDirURLs
*/
function
testMakeAbsoluteURLSubDir
(
$url
,
$expectedResult
)
{
\
OC
::
$WEBROOT
=
'/owncloud'
;
$result
=
\
OC_Helper
::
makeURLAbsolute
(
$url
);
$this
->
assertEquals
(
$expectedResult
,
$result
);
}
public
function
provideDocRootURLs
()
{
return
array
(
array
(
'index.php'
,
'http://localhost/index.php'
),
array
(
'/index.php'
,
'http://localhost/index.php'
),
array
(
'/apps/index.php'
,
'http://localhost/apps/index.php'
),
array
(
'apps/index.php'
,
'http://localhost/apps/index.php'
),
);
}
public
function
provideSubDirURLs
()
{
return
array
(
array
(
'index.php'
,
'http://localhost/owncloud/index.php'
),
array
(
'/index.php'
,
'http://localhost/owncloud/index.php'
),
array
(
'/apps/index.php'
,
'http://localhost/owncloud/apps/index.php'
),
array
(
'apps/index.php'
,
'http://localhost/owncloud/apps/index.php'
),
);
}
/**
* @small
* test linkToAbsolute URL construction
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment