From: Matthias Schmidt Date: Fri, 4 Aug 2017 18:40:53 +0000 (+0200) Subject: Fix `languageID` for newly created authors of test notifications X-Git-Tag: 3.1.0_Alpha_1~107 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c2daeb92041e9a98af9dc29b3b401c27e9d6b36;p=GitHub%2FWoltLab%2FWCF.git Fix `languageID` for newly created authors of test notifications --- 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