diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-18 15:27:17 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:50 +0100 |
commit | 358858c9e3f06560b67b69e1d15c141debb2729a (patch) | |
tree | 628d5c900c0ef3ef2882166e3229413ad75b530e /tests | |
parent | e8661a6b563129f95f7d98322006feb9da8e2c7c (diff) | |
download | nextcloud-server-358858c9e3f06560b67b69e1d15c141debb2729a.tar.gz nextcloud-server-358858c9e3f06560b67b69e1d15c141debb2729a.zip |
Fix undefined HTTP_USER_AGENT
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/appframework/http/RequestTest.php | 33 |
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() { |