summaryrefslogtreecommitdiffstats
path: root/apps/comments/tests/Unit/Notification
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-24 15:26:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-10-24 17:45:32 +0200
commit43e498844e8c1aa519a19238d2cf3d6b95e1aab0 (patch)
tree59510ef2ffc6c1fd1fd92475013b108f1da2bfeb /apps/comments/tests/Unit/Notification
parentb1f77aca4effec99387481a831910d4870ae2ffc (diff)
downloadnextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.tar.gz
nextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.zip
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/comments/tests/Unit/Notification')
-rw-r--r--apps/comments/tests/Unit/Notification/ListenerTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/comments/tests/Unit/Notification/ListenerTest.php b/apps/comments/tests/Unit/Notification/ListenerTest.php
index ef84d1c60de..cbe2b633429 100644
--- a/apps/comments/tests/Unit/Notification/ListenerTest.php
+++ b/apps/comments/tests/Unit/Notification/ListenerTest.php
@@ -71,7 +71,7 @@ class ListenerTest extends TestCase {
*/
public function testEvaluate($eventType, $notificationMethod) {
/** @var IComment|\PHPUnit_Framework_MockObject_MockObject $comment */
- $comment = $this->getMockBuilder('\OCP\Comments\IComment')->getMock();
+ $comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
->method('getObjectType')
->will($this->returnValue('files'));
@@ -90,7 +90,7 @@ class ListenerTest extends TestCase {
]);
/** @var CommentsEvent|\PHPUnit_Framework_MockObject_MockObject $event */
- $event = $this->getMockBuilder('\OCP\Comments\CommentsEvent')
+ $event = $this->getMockBuilder(CommentsEvent::class)
->disableOriginalConstructor()
->getMock();
$event->expects($this->once())
@@ -101,7 +101,7 @@ class ListenerTest extends TestCase {
->will($this->returnValue($eventType));
/** @var INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
- $notification = $this->getMockBuilder('\OCP\Notification\INotification')->getMock();
+ $notification = $this->getMockBuilder(INotification::class)->getMock();
$notification->expects($this->any())
->method($this->anything())
->will($this->returnValue($notification));
@@ -136,7 +136,7 @@ class ListenerTest extends TestCase {
*/
public function testEvaluateNoMentions($eventType) {
/** @var IComment|\PHPUnit_Framework_MockObject_MockObject $comment */
- $comment = $this->getMockBuilder('\OCP\Comments\IComment')->getMock();
+ $comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
->method('getObjectType')
->will($this->returnValue('files'));
@@ -148,7 +148,7 @@ class ListenerTest extends TestCase {
->willReturn([]);
/** @var CommentsEvent|\PHPUnit_Framework_MockObject_MockObject $event */
- $event = $this->getMockBuilder('\OCP\Comments\CommentsEvent')
+ $event = $this->getMockBuilder(CommentsEvent::class)
->disableOriginalConstructor()
->getMock();
$event->expects($this->once())
@@ -173,7 +173,7 @@ class ListenerTest extends TestCase {
public function testEvaluateUserDoesNotExist() {
/** @var IComment|\PHPUnit_Framework_MockObject_MockObject $comment */
- $comment = $this->getMockBuilder('\OCP\Comments\IComment')->getMock();
+ $comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
->method('getObjectType')
->will($this->returnValue('files'));
@@ -185,7 +185,7 @@ class ListenerTest extends TestCase {
->willReturn([[ 'type' => 'user', 'id' => 'foobar']]);
/** @var CommentsEvent|\PHPUnit_Framework_MockObject_MockObject $event */
- $event = $this->getMockBuilder('\OCP\Comments\CommentsEvent')
+ $event = $this->getMockBuilder(CommentsEvent::class)
->disableOriginalConstructor()
->getMock();
$event->expects($this->once())
@@ -196,7 +196,7 @@ class ListenerTest extends TestCase {
->will($this->returnValue(CommentsEvent::EVENT_ADD));
/** @var INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
- $notification = $this->getMockBuilder('\OCP\Notification\INotification')->getMock();
+ $notification = $this->getMockBuilder(INotification::class)->getMock();
$notification->expects($this->any())
->method($this->anything())
->will($this->returnValue($notification));