Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require to use at least desktop client 2.0 by default #1913

Merged
merged 3 commits into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -68,7 +68,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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw sure we can allow people to require more up to date versions.
But should we have 2.0.0 as a minimum as well, so when someone copied sample.config.php he now still requires 2.0.0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we have no pacakges for all platforms lets just keep this as is :)


// Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or
// "mirall/%1" for older releases
Expand Down
25 changes: 10 additions & 15 deletions apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -35,7 +36,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 @@ -69,10 +70,8 @@ public function oldDesktopClientProvider() {
* @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')
Expand All @@ -82,7 +81,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 @@ -106,10 +105,8 @@ public function newAndAlternateDesktopClientProvider() {
* @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')
Expand All @@ -119,17 +116,15 @@ 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 */
$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')
Expand Down
2 changes: 1 addition & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,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