Codeception\Module\WPDb::haveManyPostsInDatabase PHP Method

haveManyPostsInDatabase() public method

Inserts many posts in the database returning their IDs.
public haveManyPostsInDatabase ( integer $count, array $overrides = [] ) : array
$count integer The number of posts to insert.
$overrides array { An array of values to override the defaults. The `{{n}}` placeholder can be used to have the post count inserted in its place; e.g. `Post Title - {{n}}` will be set to `Post Title - 0` for the first post, `Post Title - 1` for the second one and so on. The same applies to meta values as well.
return array
    public function haveManyPostsInDatabase($count, array $overrides = [])
    {
        if (!is_int($count)) {
            throw new \InvalidArgumentException('Count must be an integer value');
        }
        $overrides = $this->setTemplateData($overrides);
        $ids = [];
        for ($i = 0; $i < $count; $i++) {
            $thisOverrides = $this->replaceNumbersInArray($overrides, $i);
            $ids[] = $this->havePostInDatabase($thisOverrides);
        }
        return $ids;
    }
WPDb