Skip to content

Commit

Permalink
Merge pull request #26441 from owncloud/DeepDiver1975-patch-1
Browse files Browse the repository at this point in the history
Require to use at least desktop client 2.0 by default
  • Loading branch information
Vincent Petry authored Oct 25, 2016
2 parents c9cff46 + 7449845 commit bf5bca5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function beforeHandler(RequestInterface $request) {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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;

Expand All @@ -33,7 +34,7 @@
* @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;
Expand Down Expand Up @@ -65,7 +66,7 @@ public function oldDesktopClientProvider() {
* @expectedExceptionMessage Unsupported client version.
*/
public function testBeforeHandlerException($userAgent) {
/** @var \Sabre\HTTP\RequestInterface $request */
/** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
$request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
Expand All @@ -76,7 +77,7 @@ public function testBeforeHandlerException($userAgent) {
$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);
Expand All @@ -100,7 +101,7 @@ public function newAndAlternateDesktopClientProvider() {
* @param string $userAgent
*/
public function testBeforeHandlerSuccess($userAgent) {
/** @var \Sabre\HTTP\RequestInterface $request */
/** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
$request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
Expand All @@ -111,14 +112,14 @@ public function testBeforeHandlerSuccess($userAgent) {
$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 */
/** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
$request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
Expand Down
2 changes: 1 addition & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@
* 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
Expand Down

0 comments on commit bf5bca5

Please sign in to comment.