]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix getMock Share
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:24:06 +0000 (20:24 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:42:38 +0000 (20:42 +0200)
tests/lib/Share/MailNotificationsTest.php
tests/lib/Share20/ShareTest.php

index 0c951d11f88e8d4a85605a234393ddd54e0375da..d56efe57c9df5ae3d4a63ca8edb92d3e0599c500 100644 (file)
@@ -60,7 +60,7 @@ class MailNotificationsTest extends \Test\TestCase {
                                ->disableOriginalConstructor()->getMock();
                $this->user = $this->getMockBuilder('\OCP\IUser')
                                ->disableOriginalConstructor()->getMock();
-               $this->urlGenerator = $this->getMock('\OCP\IURLGenerator');
+               $this->urlGenerator = $this->createMock(IURLGenerator::class);
 
                $this->l10n->expects($this->any())
                        ->method('t')
@@ -212,14 +212,17 @@ class MailNotificationsTest extends \Test\TestCase {
                $this->setupMailerMock('TestUser shared »welcome.txt« with you', ['recipient@owncloud.com' => 'Recipient'], false);
 
                /** @var MailNotifications | \PHPUnit_Framework_MockObject_MockObject $mailNotifications */
-               $mailNotifications = $this->getMock('OC\Share\MailNotifications',['getItemSharedWithUser'], [
+               $mailNotifications = $this->getMockBuilder(MailNotifications::class)
+                       ->setMethods(['getItemSharedWithUser'])
+                       ->setConstructorArgs([
                                $this->user,
                                $this->l10n,
                                $this->mailer,
                                $this->logger,
                                $this->defaults,
                                $this->urlGenerator
-               ]);
+                       ])
+                       ->getMock();
 
                $mailNotifications->method('getItemSharedWithUser')
                        ->withAnyParameters()
index 91bd2fe84b6375c7ecbb3fe93e687ef20d866034..fbdf8e5c15b1346fec3ebc99a8d182a6c3c58e69 100644 (file)
@@ -21,6 +21,7 @@
 namespace Test\Share20;
 
 use OCP\Files\IRootFolder;
+use OCP\IUserManager;
 
 /**
  * Class ShareTest
@@ -35,8 +36,8 @@ class ShareTest extends \Test\TestCase {
        protected $share;
 
        public function setUp() {
-               $this->rootFolder = $this->getMock('\OCP\Files\IRootFolder');
-               $this->userManager = $this->getMock('OCP\IUserManager');
+               $this->rootFolder = $this->createMock(IRootFolder::class);
+               $this->userManager = $this->createMock(IUserManager::class);
                $this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
        }