Codeception\Module\WPDb::haveManyCommentsInDatabase PHP Метод

haveManyCommentsInDatabase() публичный Метод

Inserts many comments in the database.
public haveManyCommentsInDatabase ( integer $count, integer $comment_post_ID, array $overrides = [] ) : int[]
$count integer The number of comments to insert.
$comment_post_ID integer The comment parent post ID.
$overrides array An associative array to override the defaults.
Результат int[] An array containing the inserted comments IDs.
    public function haveManyCommentsInDatabase($count, $comment_post_ID, 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->haveCommentInDatabase($comment_post_ID, $thisOverrides);
        }
        return $ids;
    }
WPDb