summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-10-24 22:38:22 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-10-25 18:03:10 +0200
commit9df3869bfc6a8ea998725d7b0af30a3230af2dad (patch)
treeec9f17e565d02fba67b2032acbd635a639896ee5 /apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
parent1c39b30d50ac70438bbb36e9318087c52a1f1c31 (diff)
downloadnextcloud-server-9df3869bfc6a8ea998725d7b0af30a3230af2dad.tar.gz
nextcloud-server-9df3869bfc6a8ea998725d7b0af30a3230af2dad.zip
Fix unit tests for BlockLegacyClientPlugin
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php25
1 files changed, 10 insertions, 15 deletions
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')