*
* @since 1.28
*
- * @param string[] $groups Groups the test user should be in.
+ * @param string|string[] $groups Groups the test user should be in.
* @return TestUser
*/
public static function getTestUser( $groups = [] ) {
*
* @since 1.28
*
- * @param string[] $groups Groups the test user should be added in.
+ * @param string|string[] $groups Groups the test user should be added in.
* @return TestUser
*/
public static function getMutableTestUser( $groups = [] ) {
*
* @param string $testName Caller's __CLASS__. Used to generate the
* user's username.
- * @param string[] $groups Groups the test user should be added to.
+ * @param string|string[] $groups Groups the test user should be added to.
* @return TestUser
*/
public static function getMutableTestUser( $testName, $groups = [] ) {
"TestUser $testName $id", // username
"Name $id", // real name
"$id@mediawiki.test", // e-mail
- $groups, // groups
+ (array)$groups, // groups
$password // password
);
$testUser->getUser()->clearInstanceCache();
*
* @since 1.28
*
- * @param string[] $groups Groups the test user should be added to.
+ * @param string|string[] $groups Groups the test user should be added to.
* @return TestUser
*/
public static function getImmutableTestUser( $groups = [] ) {
- $groups = array_unique( $groups );
+ $groups = array_unique( (array)$groups );
sort( $groups );
$key = implode( ',', $groups );