5dbdd8351cd49268b742f79a0835fb51d5fc7fba
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\user\notification\event;
3 use wcf\data\comment\response\LikeableCommentResponse;
4 use wcf\data\user\UserProfile;
5 use wcf\system\user\notification\object\IUserNotificationObject;
6
7 /**
8 * Default implementation of some methods of the testable user notification event interface
9 * for comment response like user notificiation events.
10 *
11 * @author Matthias Schmidt
12 * @copyright 2001-2017 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\User\Notification\Event
15 * @since 3.1
16 */
17 trait TTestableCommentResponseLikeUserNotificationEvent {
18 use TTestableCommentResponseUserNotificationEvent;
19 use TTestableLikeUserNotificationEvent {
20 TTestableLikeUserNotificationEvent::canBeTriggeredByGuests insteadof TTestableCommentResponseUserNotificationEvent;
21 TTestableLikeUserNotificationEvent::getTestObjects insteadof TTestableCommentResponseUserNotificationEvent;
22 }
23
24 /**
25 * @inheritDoc
26 */
27 protected static function createTestLikeObject(UserProfile $recipient, UserProfile $author) {
28 return new LikeableCommentResponse(self::createTestCommentResponse($recipient, $author));
29 }
30
31 /**
32 * @inheritDoc
33 */
34 public static function getTestAdditionalData(IUserNotificationObject $object) {
35 /** @var LikeableCommentResponse $likedObject */
36 $likedObject = self::getTestLikeObject($object);
37
38 return [
39 'commentID' => $likedObject->getComment()->commentID,
40 'commentUserID' => $likedObject->getComment()->userID,
41 'objectID' => $likedObject->getComment()->objectID
42 ];
43 }
44
45 /**
46 * @inheritDoc
47 */
48 protected static function getTestLikeableObjectTypeName() {
49 return 'com.woltlab.wcf.comment.response';
50 }
51 }