summaryrefslogtreecommitdiffstats
path: root/tests/lib/connector/sabre
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-23 16:33:51 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-23 16:33:51 +0200
commitab9ea97d3af62fd1c9c1f813b84e5c45a585a8d8 (patch)
tree5af6184755a710fc6642876d1df14734e19d7635 /tests/lib/connector/sabre
parent21ad4400afdc6806268d1d8c07dd97dacbe99df6 (diff)
downloadnextcloud-server-ab9ea97d3af62fd1c9c1f813b84e5c45a585a8d8.tar.gz
nextcloud-server-ab9ea97d3af62fd1c9c1f813b84e5c45a585a8d8.zip
Catch not existing User-Agent header
In case of an not sent UA header consider the client as valid
Diffstat (limited to 'tests/lib/connector/sabre')
-rw-r--r--tests/lib/connector/sabre/BlockLegacyClientPluginTest.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php b/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php
index 2c7835dd73e..05488d9716a 100644
--- a/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php
+++ b/tests/lib/connector/sabre/BlockLegacyClientPluginTest.php
@@ -97,7 +97,7 @@ class BlockLegacyClientPluginTest extends TestCase {
* @dataProvider newAndAlternateDesktopClientProvider
* @param string $userAgent
*/
- public function testBeforeHandlerSucess($userAgent) {
+ public function testBeforeHandlerSuccess($userAgent) {
/** @var \Sabre\HTTP\RequestInterface $request */
$request = $this->getMock('\Sabre\HTTP\RequestInterface');
$request
@@ -115,4 +115,15 @@ class BlockLegacyClientPluginTest extends TestCase {
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
}
+ public function testBeforeHandlerNoUserAgent() {
+ /** @var \Sabre\HTTP\RequestInterface $request */
+ $request = $this->getMock('\Sabre\HTTP\RequestInterface');
+ $request
+ ->expects($this->once())
+ ->method('getHeader')
+ ->with('User-Agent')
+ ->will($this->returnValue(null));
+ $this->blockLegacyClientVersionPlugin->beforeHandler($request);
+ }
+
}