From 8e205c685494bfb4a6f62a10319a05a0be0ef770 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 18 Nov 2015 15:27:17 +0100 Subject: Fix undefined HTTP_USER_AGENT --- tests/lib/appframework/http/RequestTest.php | 33 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'tests/lib') 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,19 +693,36 @@ 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 */ -- cgit v1.2.3