From 2c2daeb92041e9a98af9dc29b3b401c27e9d6b36 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 4 Aug 2017 20:40:53 +0200 Subject: [PATCH] Fix `languageID` for newly created authors of test notifications --- .../TestableUserNotificationEventHandler.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php index 9a5a3f4f88..2d2e3abac1 100644 --- a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php @@ -68,12 +68,15 @@ class TestableUserNotificationEventHandler extends SingletonFactory { $count = $userProfileList->countObjects(); + $languages = LanguageFactory::getInstance()->getLanguages(); + while ($count < self::MAX_AUTHOR_COUNT) { $username = substr(StringUtil::getRandomID(), 0, 10); (new UserAction([], 'create', [ 'data' => [ 'email' => $username . '@example.com', + 'languageID' => $languages[array_rand($languages)]->languageID, 'password' => PasswordUtil::getRandomPassword(), 'registrationDate' => TIME_NOW - 24 * 3600 * MathUtil::getRandomValue(10, 1000), 'username' => $username -- 2.20.1