From: Marcel Werk Date: Fri, 6 May 2022 21:46:46 +0000 (+0200) Subject: Added generic trait for article comment tests X-Git-Tag: 5.5.0_Beta_1~11^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5745de8b64543faaee6621216da7e5437771d589;p=GitHub%2FWoltLab%2FWCF.git Added generic trait for article comment tests --- 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'), + ]; + } +}