From 5745de8b64543faaee6621216da7e5437771d589 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 6 May 2022 23:46:46 +0200 Subject: [PATCH] Added generic trait for article comment tests --- ...icleCommentUserNotificationEvent.class.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/user/notification/event/TTestableArticleCommentUserNotificationEvent.class.php diff --git a/wcfsetup/install/files/lib/system/user/notification/event/TTestableArticleCommentUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/TTestableArticleCommentUserNotificationEvent.class.php new file mode 100644 index 0000000000..69e468b944 --- /dev/null +++ b/wcfsetup/install/files/lib/system/user/notification/event/TTestableArticleCommentUserNotificationEvent.class.php @@ -0,0 +1,38 @@ + + * @package WoltLabSuite\Core\System\User\Notification\Event + * @since 5.5 + */ +trait TTestableArticleCommentUserNotificationEvent +{ + use TTestableArticleUserNotificationEvent; + use TTestableCategorizedUserNotificationEvent; + + /** + * @see TTestableCommentUserNotificationEvent::createTestComment() + */ + protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) + { + return [ + 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author) + ->getArticleContent() + ->articleContentID, + 'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment'), + ]; + } +} -- 2.20.1