Fix getMock TagTest

This commit is contained in:
Roeland Jago Douma 2016-09-12 21:40:00 +02:00
parent 1d166d645b
commit 2f36bbecb8
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 4 additions and 3 deletions

View File

@ -21,6 +21,7 @@
*/ */
namespace Test; namespace Test;
use OCP\IUserSession;
/** /**
* Class TagsTest * Class TagsTest
@ -49,7 +50,7 @@ class TagsTest extends \Test\TestCase {
\OC::$server->getUserManager()->createUser($userId, 'pass'); \OC::$server->getUserManager()->createUser($userId, 'pass');
\OC_User::setUserId($userId); \OC_User::setUserId($userId);
$this->user = new \OC\User\User($userId, null); $this->user = new \OC\User\User($userId, null);
$this->userSession = $this->getMock('\OCP\IUserSession'); $this->userSession = $this->createMock(IUserSession::class);
$this->userSession $this->userSession
->expects($this->any()) ->expects($this->any())
->method('getUser') ->method('getUser')
@ -70,7 +71,7 @@ class TagsTest extends \Test\TestCase {
} }
public function testTagManagerWithoutUserReturnsNull() { public function testTagManagerWithoutUserReturnsNull() {
$this->userSession = $this->getMock('\OCP\IUserSession'); $this->userSession = $this->createMock(IUserSession::class);
$this->userSession $this->userSession
->expects($this->any()) ->expects($this->any())
->method('getUser') ->method('getUser')
@ -294,7 +295,7 @@ class TagsTest extends \Test\TestCase {
$otherUserId = $this->getUniqueID('user2_'); $otherUserId = $this->getUniqueID('user2_');
\OC::$server->getUserManager()->createUser($otherUserId, 'pass'); \OC::$server->getUserManager()->createUser($otherUserId, 'pass');
\OC_User::setUserId($otherUserId); \OC_User::setUserId($otherUserId);
$otherUserSession = $this->getMock('\OCP\IUserSession'); $otherUserSession = $this->createMock(IUserSession::class);
$otherUserSession $otherUserSession
->expects($this->any()) ->expects($this->any())
->method('getUser') ->method('getUser')