summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Comments/EntityCollectionTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-07-15 09:52:46 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-07-15 09:52:46 +0200
commit2fcb24166f8ac77a49947f14bbeaf0f1bec5dfa4 (patch)
treeb43ce551bf0a4ea1bd78de7084d3814f35beb12f /apps/dav/tests/unit/Comments/EntityCollectionTest.php
parent813b58ab947222f983fe25d56781f1f43c840538 (diff)
downloadnextcloud-server-2fcb24166f8ac77a49947f14bbeaf0f1bec5dfa4.tar.gz
nextcloud-server-2fcb24166f8ac77a49947f14bbeaf0f1bec5dfa4.zip
Fix PHPUnit 5.4 warnings in DAV app
* getMock is deprecated
Diffstat (limited to 'apps/dav/tests/unit/Comments/EntityCollectionTest.php')
-rw-r--r--apps/dav/tests/unit/Comments/EntityCollectionTest.php34
1 files changed, 27 insertions, 7 deletions
diff --git a/apps/dav/tests/unit/Comments/EntityCollectionTest.php b/apps/dav/tests/unit/Comments/EntityCollectionTest.php
index d5a6c940545..c96db595394 100644
--- a/apps/dav/tests/unit/Comments/EntityCollectionTest.php
+++ b/apps/dav/tests/unit/Comments/EntityCollectionTest.php
@@ -38,10 +38,18 @@ class EntityCollectionTest extends \Test\TestCase {
public function setUp() {
parent::setUp();
- $this->commentsManager = $this->getMock('\OCP\Comments\ICommentsManager');
- $this->userManager = $this->getMock('\OCP\IUserManager');
- $this->userSession = $this->getMock('\OCP\IUserSession');
- $this->logger = $this->getMock('\OCP\ILogger');
+ $this->commentsManager = $this->getMockBuilder('\OCP\Comments\ICommentsManager')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->userManager = $this->getMockBuilder('\OCP\IUserManager')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->userSession = $this->getMockBuilder('\OCP\IUserSession')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->logger = $this->getMockBuilder('\OCP\ILogger')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->collection = new \OCA\DAV\Comments\EntityCollection(
'19',
@@ -61,7 +69,11 @@ class EntityCollectionTest extends \Test\TestCase {
$this->commentsManager->expects($this->once())
->method('get')
->with('55')
- ->will($this->returnValue($this->getMock('\OCP\Comments\IComment')));
+ ->will($this->returnValue(
+ $this->getMockBuilder('\OCP\Comments\IComment')
+ ->disableOriginalConstructor()
+ ->getMock()
+ ));
$node = $this->collection->getChild('55');
$this->assertTrue($node instanceof \OCA\DAV\Comments\CommentNode);
@@ -83,7 +95,11 @@ class EntityCollectionTest extends \Test\TestCase {
$this->commentsManager->expects($this->once())
->method('getForObject')
->with('files', '19')
- ->will($this->returnValue([$this->getMock('\OCP\Comments\IComment')]));
+ ->will($this->returnValue([
+ $this->getMockBuilder('\OCP\Comments\IComment')
+ ->disableOriginalConstructor()
+ ->getMock()
+ ]));
$result = $this->collection->getChildren();
@@ -96,7 +112,11 @@ class EntityCollectionTest extends \Test\TestCase {
$this->commentsManager->expects($this->once())
->method('getForObject')
->with('files', '19', 5, 15, $dt)
- ->will($this->returnValue([$this->getMock('\OCP\Comments\IComment')]));
+ ->will($this->returnValue([
+ $this->getMockBuilder('\OCP\Comments\IComment')
+ ->disableOriginalConstructor()
+ ->getMock()
+ ]));
$result = $this->collection->findChildren(5, 15, $dt);