Fix `languageID` for newly created authors of test notifications
authorMatthias Schmidt <gravatronics@live.com>
Fri, 4 Aug 2017 18:40:53 +0000 (20:40 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 4 Aug 2017 18:40:53 +0000 (20:40 +0200)
wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php

index 9a5a3f4f88c8252b223028a457a6e7fe116b0d2f..2d2e3abac17636fdf1be5b226efb48de600e07fb 100644 (file)
@@ -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