diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-10-20 13:35:23 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-10-20 15:09:44 +0200 |
commit | 4ce3c25c5c90725e203a8fc2ab24eb5d7cc514bb (patch) | |
tree | fbe68f98b4acda2da3ed47d670136a5d22574446 | |
parent | 8f8abdbaeef7bcaff1f822714a7f227933cc43c1 (diff) | |
download | nextcloud-server-4ce3c25c5c90725e203a8fc2ab24eb5d7cc514bb.tar.gz nextcloud-server-4ce3c25c5c90725e203a8fc2ab24eb5d7cc514bb.zip |
Add "$_SERVER['REQUEST_URI']" to fix the unit tests
Let's hope that works
-rw-r--r-- | tests/lib/templatelayout.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/lib/templatelayout.php b/tests/lib/templatelayout.php index f87db4fa54b..87e5f1b50bd 100644 --- a/tests/lib/templatelayout.php +++ b/tests/lib/templatelayout.php @@ -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)); } } |