diff options
Diffstat (limited to 'apps/dav/tests/unit/Comments/CommentsNodeTest.php')
-rw-r--r-- | apps/dav/tests/unit/Comments/CommentsNodeTest.php | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index 1c0551671f8..9d0e56041d0 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -82,23 +82,23 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->once()) ->method('getId') - ->will($this->returnValue('19')); + ->willReturn('19'); $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->once()) ->method('delete') @@ -117,22 +117,22 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('mallory')); + ->willReturn('mallory'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->never()) ->method('getId'); $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->never()) ->method('delete'); @@ -144,7 +144,7 @@ class CommentsNodeTest extends \Test\TestCase { $id = '19'; $this->comment->expects($this->once()) ->method('getId') - ->will($this->returnValue($id)); + ->willReturn($id); $this->assertSame($this->node->getName(), $id); } @@ -169,11 +169,11 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->once()) ->method('setMessage') @@ -181,11 +181,11 @@ class CommentsNodeTest extends \Test\TestCase { $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->once()) ->method('save') @@ -207,11 +207,11 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->once()) ->method('setMessage') @@ -220,11 +220,11 @@ class CommentsNodeTest extends \Test\TestCase { $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->never()) ->method('save'); @@ -246,11 +246,11 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->once()) ->method('setMessage') @@ -258,11 +258,11 @@ class CommentsNodeTest extends \Test\TestCase { $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->never()) ->method('save'); @@ -286,22 +286,22 @@ class CommentsNodeTest extends \Test\TestCase { $user->expects($this->once()) ->method('getUID') - ->will($this->returnValue('mallory')); + ->willReturn('mallory'); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->never()) ->method('setMessage'); $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->comment->expects($this->any()) ->method('getActorId') - ->will($this->returnValue('alice')); + ->willReturn('alice'); $this->commentsManager->expects($this->never()) ->method('save'); @@ -324,14 +324,14 @@ class CommentsNodeTest extends \Test\TestCase { $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue($user)); + ->willReturn($user); $this->comment->expects($this->never()) ->method('setMessage'); $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('bots')); + ->willReturn('bots'); $this->commentsManager->expects($this->never()) ->method('save'); @@ -347,14 +347,14 @@ class CommentsNodeTest extends \Test\TestCase { $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue(null)); + ->willReturn(null); $this->comment->expects($this->never()) ->method('setMessage'); $this->comment->expects($this->any()) ->method('getActorType') - ->will($this->returnValue('users')); + ->willReturn('users'); $this->commentsManager->expects($this->never()) ->method('save'); @@ -415,23 +415,23 @@ class CommentsNodeTest extends \Test\TestCase { $this->comment->expects($this->once()) ->method('getId') - ->will($this->returnValue($expected[$ns . 'id'])); + ->willReturn($expected[$ns . 'id']); $this->comment->expects($this->once()) ->method('getParentId') - ->will($this->returnValue($expected[$ns . 'parentId'])); + ->willReturn($expected[$ns . 'parentId']); $this->comment->expects($this->once()) ->method('getTopmostParentId') - ->will($this->returnValue($expected[$ns . 'topmostParentId'])); + ->willReturn($expected[$ns . 'topmostParentId']); $this->comment->expects($this->once()) ->method('getChildrenCount') - ->will($this->returnValue($expected[$ns . 'childrenCount'])); + ->willReturn($expected[$ns . 'childrenCount']); $this->comment->expects($this->once()) ->method('getMessage') - ->will($this->returnValue($expected[$ns . 'message'])); + ->willReturn($expected[$ns . 'message']); $this->comment->expects($this->once()) ->method('getMentions') @@ -442,43 +442,43 @@ class CommentsNodeTest extends \Test\TestCase { $this->comment->expects($this->once()) ->method('getVerb') - ->will($this->returnValue($expected[$ns . 'verb'])); + ->willReturn($expected[$ns . 'verb']); $this->comment->expects($this->exactly(2)) ->method('getActorType') - ->will($this->returnValue($expected[$ns . 'actorType'])); + ->willReturn($expected[$ns . 'actorType']); $this->comment->expects($this->exactly(2)) ->method('getActorId') - ->will($this->returnValue($expected[$ns . 'actorId'])); + ->willReturn($expected[$ns . 'actorId']); $this->comment->expects($this->once()) ->method('getCreationDateTime') - ->will($this->returnValue($expected[$ns . 'creationDateTime'])); + ->willReturn($expected[$ns . 'creationDateTime']); $this->comment->expects($this->once()) ->method('getLatestChildDateTime') - ->will($this->returnValue($expected[$ns . 'latestChildDateTime'])); + ->willReturn($expected[$ns . 'latestChildDateTime']); $this->comment->expects($this->once()) ->method('getObjectType') - ->will($this->returnValue($expected[$ns . 'objectType'])); + ->willReturn($expected[$ns . 'objectType']); $this->comment->expects($this->once()) ->method('getObjectId') - ->will($this->returnValue($expected[$ns . 'objectId'])); + ->willReturn($expected[$ns . 'objectId']); $user = $this->getMockBuilder(IUser::class) ->disableOriginalConstructor() ->getMock(); $user->expects($this->once()) ->method('getDisplayName') - ->will($this->returnValue($expected[$ns . 'actorDisplayName'])); + ->willReturn($expected[$ns . 'actorDisplayName']); $this->userManager->expects($this->once()) ->method('get') ->with('alice') - ->will($this->returnValue($user)); + ->willReturn($user); $properties = $this->node->getProperties(null); @@ -509,7 +509,7 @@ class CommentsNodeTest extends \Test\TestCase { public function testGetPropertiesUnreadProperty($creationDT, $readDT, $expected) { $this->comment->expects($this->any()) ->method('getCreationDateTime') - ->will($this->returnValue($creationDT)); + ->willReturn($creationDT); $this->comment->expects($this->any()) ->method('getMentions') @@ -517,15 +517,15 @@ class CommentsNodeTest extends \Test\TestCase { $this->commentsManager->expects($this->once()) ->method('getReadMark') - ->will($this->returnValue($readDT)); + ->willReturn($readDT); $this->userSession->expects($this->once()) ->method('getUser') - ->will($this->returnValue( + ->willReturn( $this->getMockBuilder(IUser::class) ->disableOriginalConstructor() ->getMock() - )); + ); $properties = $this->node->getProperties(null); |