[Pkg-owncloud-commits] [owncloud] 31/46: Add "$_SERVER['REQUEST_URI']" to fix the unit tests
David Prévot
taffit at moszumanska.debian.org
Fri Oct 24 15:11:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 841998bdcbda0eee655b4cb8d93eba4373007a72
Author: Lukas Reschke <lukas at owncloud.com>
Date: Mon Oct 20 13:35:23 2014 +0200
Add "$_SERVER['REQUEST_URI']" to fix the unit tests
Let's hope that works
---
tests/lib/templatelayout.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/lib/templatelayout.php b/tests/lib/templatelayout.php
index f87db4f..87e5f1b 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));
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list