[Pkg-owncloud-commits] [owncloud] 86/239: adding simple unit test to test scriptName() under overwrite condition
David Prévot
taffit at moszumanska.debian.org
Fri Nov 29 01:32:22 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 229630f14c64c4a0889f567fc8ac2159a63cbb90
Author: Thomas Mueller <thomas.mueller at tmit.eu>
Date: Sun Nov 24 21:19:06 2013 +0100
adding simple unit test to test scriptName() under overwrite condition
---
tests/lib/request.php | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/lib/request.php b/tests/lib/request.php
new file mode 100644
index 0000000..2b2094a
--- /dev/null
+++ b/tests/lib/request.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Copyright (c) 2013 Thomas Müller <thomas.mueller at tmit.eu>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class Test_Request extends PHPUnit_Framework_TestCase {
+
+ public function setUp() {
+ OC_Config::setValue('overwritewebroot', '/domain.tld/ownCloud');
+ }
+
+ public function tearDown() {
+ OC_Config::setValue('overwritewebroot', '');
+ }
+
+ public function testScriptNameOverWrite() {
+ $_SERVER['REMOTE_ADDR'] = '10.0.0.1';
+ $_SERVER["SCRIPT_FILENAME"] = __FILE__;
+
+ $scriptName = OC_Request::scriptName();
+ $this->assertEquals('/domain.tld/ownCloud/tests/lib/request.php', $scriptName);
+ }
+}
--
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