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
4ce3c25c
Commit
4ce3c25c
authored
Oct 20, 2014
by
Lukas Reschke
Browse files
Add "$_SERVER['REQUEST_URI']" to fix the unit tests
Let's hope that works
parent
8f8abdba
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/lib/templatelayout.php
View file @
4ce3c25c
...
...
@@ -30,6 +30,9 @@ class OC_TemplateLayout extends \PHPUnit_Framework_TestCase {
* @dataProvider validFilePathProvider
*/
public
function
testConvertToRelativePath
(
$absolutePath
,
$expected
)
{
$_SERVER
[
'REQUEST_URI'
]
=
$expected
;
$_SERVER
[
'SCRIPT_NAME'
]
=
'/'
;
$relativePath
=
\
Test_Helper
::
invokePrivate
(
new
\
OC_TemplateLayout
(
'user'
),
'convertToRelativePath'
,
array
(
$absolutePath
));
$this
->
assertEquals
(
$expected
,
$relativePath
);
}
...
...
@@ -39,6 +42,10 @@ class OC_TemplateLayout extends \PHPUnit_Framework_TestCase {
* @expectedExceptionMessage $filePath is not under the \OC::$SERVERROOT
*/
public
function
testInvalidConvertToRelativePath
()
{
\
Test_Helper
::
invokePrivate
(
new
\
OC_TemplateLayout
(
'user'
),
'convertToRelativePath'
,
array
(
'/this/file/is/invalid'
));
$invalidFile
=
'/this/file/is/invalid'
;
$_SERVER
[
'REQUEST_URI'
]
=
$invalidFile
;
$_SERVER
[
'SCRIPT_NAME'
]
=
'/'
;
\
Test_Helper
::
invokePrivate
(
new
\
OC_TemplateLayout
(
'user'
),
'convertToRelativePath'
,
array
(
$invalidFile
));
}
}
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