src/Codeception/Module/WPDb.php
public function dontHaveUserInDatabase($userIdOrLogin, $purgeMeta = true)
    {
        $userId = is_numeric($userIdOrLogin) ? intval($userIdOrLogin) : $this->grabUserIdFromDatabase($userIdOrLogin);
        $this->dontHaveInDatabase($this->grabPrefixedTableNameFor('users'), ['ID' => $userId]);
        if ($purgeMeta) {
            $this->dontHaveInDatabase($this->grabPrefixedTableNameFor('usermeta'), ['user_id' => $userId]);
        }
    }
public function dontHaveUserInDatabase($userIdOrLogin, $purgeMeta = true)
    {
        $userId = is_numeric($userIdOrLogin) ? intval($userIdOrLogin) : $this->grabUserIdFromDatabase($userIdOrLogin);
        $this->dontHaveInDatabase($this->grabPrefixedTableNameFor('users'), ['ID' => $userId]);
        if ($purgeMeta) {
            $this->dontHaveInDatabase($this->grabPrefixedTableNameFor('usermeta'), ['user_id' => $userId]);
        }
    }
public function dontHaveUserInDatabase ( $ userIdOrLogin , $ purgeMeta = true ) { $ userId = is_numeric ( $ userIdOrLogin ) ? intval ( $ userIdOrLogin ) : $ this -> grabUserIdFromDatabase ( $ userIdOrLogin ) ; $ this -> dontHaveInDatabase ( $ this -> grabPrefixedTableNameFor ( 'users' ) , [ 'ID' => $ userId ] ) ; if ( $ purgeMeta ) { $ this -> dontHaveInDatabase ( $ this -> grabPrefixedTableNameFor ( 'usermeta' ) , [ 'user_id' => $ userId ] ) ; } }
Removes a user from the database.

@example
```php
$bob = $I->haveUserInDatabase('bob');
$alice = $I->haveUserInDatabase('alice');
// Remove Bob's user and meta.
$I->dontHaveUserInDatabase('bob');
// Remove Alice's user but not meta.
$I->dontHaveUserInDatabase($alice);
```

@param int|string $userIdOrLogin The user ID or login name.
@param bool       $purgeMeta Whether the user meta should be purged alongside the user or not.
Removes a user from the database .