src/Codeception/Module/WPDb.php
public function haveManyUsersInDatabase($count, $user_login, $role = 'subscriber', array $overrides = [])
    {
        if (!is_int($count)) {
            throw new \InvalidArgumentException('Count must be an integer value');
        }
        $ids = [];
        $overrides = $this->setTemplateData($overrides);
        for ($i = 0; $i < $count; $i++) {
            $thisOverrides = $this->replaceNumbersInArray($overrides, $i);
            $thisUserLogin = false === strpos(
                $user_login,
                $this->numberPlaceholder
            ) ? $user_login . '_' . $i : $this->replaceNumbersInString($user_login, $i);
            $ids[] = $this->haveUserInDatabase($thisUserLogin, $role, $thisOverrides);
        }

        return $ids;
    }
public function haveManyUsersInDatabase($count, $user_login, $role = 'subscriber', array $overrides = [])
    {
        if (!is_int($count)) {
            throw new \InvalidArgumentException('Count must be an integer value');
        }
        $ids = [];
        $overrides = $this->setTemplateData($overrides);
        for ($i = 0; $i < $count; $i++) {
            $thisOverrides = $this->replaceNumbersInArray($overrides, $i);
            $thisUserLogin = false === strpos(
                $user_login,
                $this->numberPlaceholder
            ) ? $user_login . '_' . $i : $this->replaceNumbersInString($user_login, $i);
            $ids[] = $this->haveUserInDatabase($thisUserLogin, $role, $thisOverrides);
        }

        return $ids;
    }
public function haveManyUsersInDatabase ( $ count , $ user_login , $ role = 'subscriber' , array $ overrides = [ ] ) { if ( ! is_int ( $ count ) ) { throw new \ InvalidArgumentException ( 'Count must be an integer value' ) ; } $ ids = [ ] ; $ overrides = $ this -> setTemplateData ( $ overrides ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ thisOverrides = $ this -> replaceNumbersInArray ( $ overrides , $ i ) ; $ thisUserLogin = false === strpos ( $ user_login , $ this -> numberPlaceholder ) ? $ user_login . '_' . $ i : $ this -> replaceNumbersInString ( $ user_login , $ i ) ; $ ids [ ] = $ this -> haveUserInDatabase ( $ thisUserLogin , $ role , $ thisOverrides ) ; } return $ ids ; }
Inserts many users in the database.

@example
```php
$subscribers = $I->haveManyUsersInDatabase(5, 'user-{{n}}');
$editors = $I->haveManyUsersInDatabase(
5,
'user-{{n}}',
'editor',
['user_email' => 'user-{{n}}@example.org']
);
```

@param int    $count      The number of users to insert.
@param string $user_login The user login name.
@param string $role       The user role.
@param array  $overrides  An array of values to override the default ones.

@return array An array of user IDs.
Inserts many users in the database .