diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-15 20:07:07 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-15 20:07:07 +0200 |
commit | 09f4ce43890f62f682c08594ed464f7f1ec7eaac (patch) | |
tree | 70ab2916670891b3c8fb16e2a20886de9c8512b8 /tests/Core | |
parent | cf3cfca356962899d535e7c018486654a6fc8d0f (diff) | |
download | nextcloud-server-09f4ce43890f62f682c08594ed464f7f1ec7eaac.tar.gz nextcloud-server-09f4ce43890f62f682c08594ed464f7f1ec7eaac.zip |
Fix mock call in AvatarControllerTest
Diffstat (limited to 'tests/Core')
-rw-r--r-- | tests/Core/Controller/AvatarControllerTest.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 937d8aaf17b..4a7b7f21784 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -32,7 +32,7 @@ use Punic\Exception; use Test\Traits\UserTrait; /** - * Overwrite is_uploaded_file in this namespace to allow proper unit testing of + * Overwrite is_uploaded_file in this namespace to allow proper unit testing of * the postAvatar call. */ function is_uploaded_file($filename) { @@ -68,19 +68,19 @@ class AvatarControllerTest extends \Test\TestCase { $app = new Application; $this->container = $app->getContainer(); $this->container['AppName'] = 'core'; - $this->container['AvatarManager'] = $this->getMock('OCP\IAvatarManager'); + $this->container['AvatarManager'] = $this->getMockBuilder('OCP\IAvatarManager')->getMock(); $this->container['Cache'] = $this->getMockBuilder('OC\Cache\File') ->disableOriginalConstructor()->getMock(); - $this->container['L10N'] = $this->getMock('OCP\IL10N'); + $this->container['L10N'] = $this->getMockBuilder('OCP\IL10N')->getMock(); $this->container['L10N']->method('t')->will($this->returnArgument(0)); - $this->container['UserManager'] = $this->getMock('OCP\IUserManager'); - $this->container['UserSession'] = $this->getMock('OCP\IUserSession'); - $this->container['Request'] = $this->getMock('OCP\IRequest'); - $this->container['UserFolder'] = $this->getMock('OCP\Files\Folder'); - $this->container['Logger'] = $this->getMock('OCP\ILogger'); + $this->container['UserManager'] = $this->getMockBuilder('OCP\IUserManager')->getMock(); + $this->container['UserSession'] = $this->getMockBuilder('OCP\IUserSession')->getMock(); + $this->container['Request'] = $this->getMockBuilder('OCP\IRequest')->getMock(); + $this->container['UserFolder'] = $this->getMockBuilder('OCP\Files\Folder')->getMock(); + $this->container['Logger'] = $this->getMockBuilder('OCP\ILogger')->getMock(); - $this->avatarMock = $this->getMock('OCP\IAvatar'); - $this->userMock = $this->getMock('OCP\IUser'); + $this->avatarMock = $this->getMockBuilder('OCP\IAvatar')->getMock(); + $this->userMock = $this->getMockBuilder('OCP\IUser')->getMock(); $this->avatarController = $this->container['AvatarController']; @@ -91,7 +91,7 @@ class AvatarControllerTest extends \Test\TestCase { ->willReturnMap([['userId', $this->userMock]]); $this->container['UserSession']->method('getUser')->willReturn($this->userMock); - $this->avatarFile = $this->getMock('OCP\Files\File'); + $this->avatarFile = $this->getMockBuilder('OCP\Files\File')->getMock(); $this->avatarFile->method('getContent')->willReturn('image data'); $this->avatarFile->method('getMimeType')->willReturn('image type'); $this->avatarFile->method('getEtag')->willReturn('my etag'); @@ -326,7 +326,7 @@ class AvatarControllerTest extends \Test\TestCase { * Test posting avatar from existing folder */ public function testPostAvatarFromNoFile() { - $file = $this->getMock('OCP\Files\Node'); + $file = $this->getMockBuilder('OCP\Files\Node')->getMock(); $this->container['UserFolder'] ->method('get') ->with('folder') |