src/Codeception/Module/WPDb.php
public function havePostmetaInDatabase($postId, $meta_key, $meta_value)
    {
        if (!is_int($postId)) {
            throw new \BadMethodCallException('Post id must be an int', 1);
        }
        if (!is_string($meta_key)) {
            throw new \BadMethodCallException('Meta key must be an string', 3);
        }
        $tableName = $this->grabPostMetaTableName();

        return $this->haveInDatabase($tableName, [
            'post_id' => $postId,
            'meta_key' => $meta_key,
            'meta_value' => $this->maybeSerialize($meta_value),
        ]);
    }
public function havePostmetaInDatabase($postId, $meta_key, $meta_value)
    {
        if (!is_int($postId)) {
            throw new \BadMethodCallException('Post id must be an int', 1);
        }
        if (!is_string($meta_key)) {
            throw new \BadMethodCallException('Meta key must be an string', 3);
        }
        $tableName = $this->grabPostMetaTableName();

        return $this->haveInDatabase($tableName, [
            'post_id' => $postId,
            'meta_key' => $meta_key,
            'meta_value' => $this->maybeSerialize($meta_value),
        ]);
    }
public function havePostmetaInDatabase ( $ postId , $ meta_key , $ meta_value ) { if ( ! is_int ( $ postId ) ) { throw new \ BadMethodCallException ( 'Post id must be an int' , 1 ) ; } if ( ! is_string ( $ meta_key ) ) { throw new \ BadMethodCallException ( 'Meta key must be an string' , 3 ) ; } $ tableName = $ this -> grabPostMetaTableName ( ) ; return $ this -> haveInDatabase ( $ tableName , [ 'post_id' => $ postId , 'meta_key' => $ meta_key , 'meta_value' => $ this -> maybeSerialize ( $ meta_value ) , ] ) ; }
Adds one or more meta key and value couples in the database for a post.

@example
```php
// Set the post-meta for a post.
$I->havePostmetaInDatabase($postId, 'karma', 23);
// Set an array post-meta for a post, it will be serialized in the db.
$I->havePostmetaInDatabase($postId, 'data', ['one', 'two']);
// Use a loop to insert one meta per row.
foreach( ['one', 'two'] as $value){
$I->havePostmetaInDatabase($postId, 'data', $value);
}
```
@param int    $postId     The post ID.
@param string $meta_key   The meta key.
@param mixed  $meta_value The value to insert in the database, objects and arrays will be serialized.

@return int The inserted meta `meta_id`.
Adds one or more meta key and value couples in the database for a post .