diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-02 10:40:48 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-09-06 09:29:27 +0200 |
commit | 9cd637487877212a29009a4be4039b8d4fc53e1e (patch) | |
tree | 45452b1b49952e31a83958e73e5339642a14a7e5 /apps | |
parent | c629761fea1be21be1cef7fdfd8673a45d3244c3 (diff) | |
download | nextcloud-server-9cd637487877212a29009a4be4039b8d4fc53e1e.tar.gz nextcloud-server-9cd637487877212a29009a4be4039b8d4fc53e1e.zip |
Fix getMock files
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/tests/BackgroundJob/ScanFilesTest.php | 7 | ||||
-rw-r--r-- | apps/files/tests/Controller/ApiControllerTest.php | 9 | ||||
-rw-r--r-- | apps/files/tests/Service/TagServiceTest.php | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php index 16bf1d793b7..877c3bafd6d 100644 --- a/apps/files/tests/BackgroundJob/ScanFilesTest.php +++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php @@ -21,6 +21,7 @@ */ namespace OCA\Files\Tests\BackgroundJob; +use OCP\IUser; use Test\TestCase; use OCP\IConfig; use OCP\IUserManager; @@ -42,8 +43,8 @@ class ScanFilesTest extends TestCase { public function setUp() { parent::setUp(); - $this->config = $this->getMock('\OCP\IConfig'); - $this->userManager = $this->getMock('\OCP\IUserManager'); + $this->config = $this->createMock(IConfig::class); + $this->userManager = $this->createMock(IUserManager::class); $this->scanFiles = $this->getMockBuilder('\OCA\Files\BackgroundJob\ScanFiles') ->setConstructorArgs([ @@ -79,7 +80,7 @@ class ScanFilesTest extends TestCase { } public function testRunWithUsers() { - $fakeUser = $this->getMock('\OCP\IUser'); + $fakeUser = $this->createMock(IUser::class); $this->config ->expects($this->at(0)) ->method('getAppValue') diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php index 348150e0e08..9bfc6d6f5e8 100644 --- a/apps/files/tests/Controller/ApiControllerTest.php +++ b/apps/files/tests/Controller/ApiControllerTest.php @@ -30,6 +30,9 @@ use OC\Files\FileInfo; use OCP\AppFramework\Http; use OCP\Files\NotFoundException; use OCP\Files\StorageNotAvailableException; +use OCP\IConfig; +use OCP\IUser; +use OCP\IUserSession; use Test\TestCase; use OCP\IRequest; use OCA\Files\Service\TagService; @@ -66,11 +69,11 @@ class ApiControllerTest extends TestCase { $this->request = $this->getMockBuilder('\OCP\IRequest') ->disableOriginalConstructor() ->getMock(); - $this->user = $this->getMock('\OCP\IUser'); + $this->user = $this->createMock(IUser::class); $this->user->expects($this->any()) ->method('getUID') ->will($this->returnValue('user1')); - $userSession = $this->getMock('\OCP\IUserSession'); + $userSession = $this->createMock(IUserSession::class); $userSession->expects($this->any()) ->method('getUser') ->will($this->returnValue($this->user)); @@ -83,7 +86,7 @@ class ApiControllerTest extends TestCase { $this->preview = $this->getMockBuilder('\OCP\IPreview') ->disableOriginalConstructor() ->getMock(); - $this->config = $this->getMock('\OCP\IConfig'); + $this->config = $this->createMock(IConfig::class); $this->userFolder = $this->getMockBuilder('\OC\Files\Node\Folder') ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files/tests/Service/TagServiceTest.php b/apps/files/tests/Service/TagServiceTest.php index 388c9c28fa1..b8d36487585 100644 --- a/apps/files/tests/Service/TagServiceTest.php +++ b/apps/files/tests/Service/TagServiceTest.php @@ -25,6 +25,7 @@ namespace OCA\Files\Tests\Service; use OCA\Files\Service\TagService; +use OCP\IUserSession; /** * Class TagServiceTest @@ -66,7 +67,7 @@ class TagServiceTest extends \Test\TestCase { /** * @var \OCP\IUserSession */ - $userSession = $this->getMock('\OCP\IUserSession'); + $userSession = $this->createMock(IUserSession::class); $userSession->expects($this->any()) ->method('getUser') ->withAnyParameters() |