2 namespace wcf\system\user\notification\event;
3 use wcf\data\article\Article;
4 use wcf\data\article\ArticleAction;
5 use wcf\data\category\Category;
6 use wcf\data\user\UserProfile;
9 * Provides a method to create a article for testing user notification
12 * @author Joshua Ruesweg
13 * @copyright 2001-2018 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\System\User\Notification\Event
18 trait TTestableArticleUserNotificationEvent {
20 * Creates an test article.
22 * @param Category $category
23 * @param UserProfile $author
26 public static function getTestArticle(Category $category, UserProfile $author) {
27 /** @var Article $article */
28 $article = (new ArticleAction([], 'create', [
31 'categoryID' => $category->categoryID,
32 'publicationStatus' => Article::PUBLISHED,
33 'publicationDate' => TIME_NOW,
34 'enableComments' => 1,
35 'userID' => $author->userID,
36 'username' => $author->username,
37 'isMultilingual' => 0,
42 'title' => 'Test Article',
43 'teaser' => 'Test Article Teaser',
44 'content' => 'Test Article Content',
46 'teaserImageID' => null
49 ]))->executeAction()['returnValues'];