aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-18 15:27:17 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-12-29 11:45:34 +0100
commit8e205c685494bfb4a6f62a10319a05a0be0ef770 (patch)
tree882f505d83a1baa3e9f04418b55b8e6728e868d6 /tests/lib
parent6b9b12e0c0aa99507ac8ceedd4d2a825516c3889 (diff)
downloadnextcloud-server-8e205c685494bfb4a6f62a10319a05a0be0ef770.tar.gz
nextcloud-server-8e205c685494bfb4a6f62a10319a05a0be0ef770.zip
Fix undefined HTTP_USER_AGENT
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/appframework/http/RequestTest.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index f628a30f1da..ab5fe154441 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -693,20 +693,37 @@ class RequestTest extends \Test\TestCase {
*/
public function testUserAgent($testAgent, $userAgent, $matches) {
$request = new Request(
- [
- 'server' => [
- 'HTTP_USER_AGENT' => $testAgent,
- ]
- ],
- $this->secureRandom,
- $this->config,
- $this->stream
+ [
+ 'server' => [
+ 'HTTP_USER_AGENT' => $testAgent,
+ ]
+ ],
+ $this->secureRandom,
+ $this->config,
+ $this->stream
);
$this->assertSame($matches, $request->isUserAgent($userAgent));
}
/**
+ * @dataProvider userAgentProvider
+ * @param string $testAgent
+ * @param array $userAgent
+ * @param bool $matches
+ */
+ public function testUndefinedUserAgent($testAgent, $userAgent, $matches) {
+ $request = new Request(
+ [],
+ $this->secureRandom,
+ $this->config,
+ $this->stream
+ );
+
+ $this->assertFalse($request->isUserAgent($userAgent));
+ }
+
+ /**
* @return array
*/
function userAgentProvider() {