src/Codeception/Module/WPDb.php
public function haveUserMetaInDatabase($userId, $meta_key, $meta_value)
    {
        $ids = [];
        $meta_values = is_array($meta_value) ? $meta_value : [$meta_value];
        foreach ($meta_values as $meta_value) {
            $data = [
                'user_id' => $userId,
                'meta_key' => $meta_key,
                'meta_value' => $this->maybeSerialize($meta_value),
            ];
            $ids[] = $this->haveInDatabase($this->grabUsermetaTableName(), $data);
        }

        return $ids;
    }
public function haveUserMetaInDatabase($userId, $meta_key, $meta_value)
    {
        $ids = [];
        $meta_values = is_array($meta_value) ? $meta_value : [$meta_value];
        foreach ($meta_values as $meta_value) {
            $data = [
                'user_id' => $userId,
                'meta_key' => $meta_key,
                'meta_value' => $this->maybeSerialize($meta_value),
            ];
            $ids[] = $this->haveInDatabase($this->grabUsermetaTableName(), $data);
        }

        return $ids;
    }
public function haveUserMetaInDatabase ( $ userId , $ meta_key , $ meta_value ) { $ ids = [ ] ; $ meta_values = is_array ( $ meta_value ) ? $ meta_value : [ $ meta_value ] ; foreach ( $ meta_values as $ meta_value ) { $ data = [ 'user_id' => $ userId , 'meta_key' => $ meta_key , 'meta_value' => $ this -> maybeSerialize ( $ meta_value ) , ] ; $ ids [ ] = $ this -> haveInDatabase ( $ this -> grabUsermetaTableName ( ) , $ data ) ; } return $ ids ; }
Sets a user meta in the database.

@example
```php
$userId = $I->haveUserInDatabase('luca', 'editor');
$I->haveUserMetaInDatabase($userId, 'karma', 23);
```

@param int    $userId The user ID.
@param string $meta_key The meta key to set the value for.
@param mixed  $meta_value Either a single value or an array of values; objects will be serialized while array of
values will trigger the insertion of multiple rows.

@return array An array of inserted `umeta_id`s.
Sets a user meta in the database .