diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-10-25 22:04:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 22:04:15 +0200 |
commit | d89c1a49c145ba13524676a693b5ca0118d0ab94 (patch) | |
tree | f74495b1a12127d81ffc7237fa544dbfb1a8cfdd | |
parent | 35c7ecef6a1e9946bc32a31a3cfadffc0178ae7d (diff) | |
parent | 1f90949e665a56617e5a783b51a84be3b17c1d15 (diff) | |
download | nextcloud-server-d89c1a49c145ba13524676a693b5ca0118d0ab94.tar.gz nextcloud-server-d89c1a49c145ba13524676a693b5ca0118d0ab94.zip |
Merge pull request #1913 from nextcloud/downstream-26441
Require to use at least desktop client 2.0 by default
-rw-r--r-- | apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php | 25 | ||||
-rw-r--r-- | config/config.sample.php | 2 |
3 files changed, 12 insertions, 17 deletions
diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php index 5d39d83a287..616816d3496 100644 --- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php +++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php @@ -68,7 +68,7 @@ class BlockLegacyClientPlugin extends ServerPlugin { return; } - $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '1.7.0'); + $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.0.0'); // Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or // "mirall/%1" for older releases diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php index 933460a630c..eb1689089a4 100644 --- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php @@ -26,6 +26,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; +use PHPUnit_Framework_MockObject_MockObject; use Test\TestCase; use OCP\IConfig; @@ -35,7 +36,7 @@ use OCP\IConfig; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class BlockLegacyClientPluginTest extends TestCase { - /** @var IConfig */ + /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */ private $config; /** @var BlockLegacyClientPlugin */ private $blockLegacyClientVersionPlugin; @@ -69,10 +70,8 @@ class BlockLegacyClientPluginTest extends TestCase { * @expectedExceptionMessage Unsupported client version. */ public function testBeforeHandlerException($userAgent) { - /** @var \Sabre\HTTP\RequestInterface $request */ - $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') - ->disableOriginalConstructor() - ->getMock(); + /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */ + $request = $this->createMock('\Sabre\HTTP\RequestInterface'); $request ->expects($this->once()) ->method('getHeader') @@ -82,7 +81,7 @@ class BlockLegacyClientPluginTest extends TestCase { $this->config ->expects($this->once()) ->method('getSystemValue') - ->with('minimum.supported.desktop.version', '1.7.0') + ->with('minimum.supported.desktop.version', '2.0.0') ->will($this->returnValue('1.7.0')); $this->blockLegacyClientVersionPlugin->beforeHandler($request); @@ -106,10 +105,8 @@ class BlockLegacyClientPluginTest extends TestCase { * @param string $userAgent */ public function testBeforeHandlerSuccess($userAgent) { - /** @var \Sabre\HTTP\RequestInterface $request */ - $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') - ->disableOriginalConstructor() - ->getMock(); + /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */ + $request = $this->createMock('\Sabre\HTTP\RequestInterface'); $request ->expects($this->once()) ->method('getHeader') @@ -119,17 +116,15 @@ class BlockLegacyClientPluginTest extends TestCase { $this->config ->expects($this->once()) ->method('getSystemValue') - ->with('minimum.supported.desktop.version', '1.7.0') + ->with('minimum.supported.desktop.version', '2.0.0') ->will($this->returnValue('1.7.0')); $this->blockLegacyClientVersionPlugin->beforeHandler($request); } public function testBeforeHandlerNoUserAgent() { - /** @var \Sabre\HTTP\RequestInterface $request */ - $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') - ->disableOriginalConstructor() - ->getMock(); + /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */ + $request = $this->createMock('\Sabre\HTTP\RequestInterface'); $request ->expects($this->once()) ->method('getHeader') diff --git a/config/config.sample.php b/config/config.sample.php index df1e2d16fc0..7f4b3345642 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1174,7 +1174,7 @@ $CONFIG = array( * client may not function as expected, and could lead to permanent data loss for * clients or other unexpected results. */ -'minimum.supported.desktop.version' => '1.7.0', +'minimum.supported.desktop.version' => '2.0.0', /** * EXPERIMENTAL: option whether to include external storage in quota |