src/Codeception/Module/WPDb.php
public function haveManyBlogsInDatabase($count, array $overrides = [], $subdomain = true)
    {
        $blogIds = [];
        $overrides = $this->setTemplateData($overrides);
        for ($i = 0; $i < $count; $i++) {
            $blogOverrides = $this->replaceNumbersInArray($overrides, $i);
            $domainOrPath = 'blog-' . $i;

            if (isset($blogOverrides['slug'])) {
                $domainOrPath = $blogOverrides['slug'];
                unset($blogOverrides['slug']);
            }

            $blogIds[] = $this->haveBlogInDatabase($domainOrPath, $blogOverrides, $subdomain);
        }

        return $blogIds;
    }
public function haveManyBlogsInDatabase($count, array $overrides = [], $subdomain = true)
    {
        $blogIds = [];
        $overrides = $this->setTemplateData($overrides);
        for ($i = 0; $i < $count; $i++) {
            $blogOverrides = $this->replaceNumbersInArray($overrides, $i);
            $domainOrPath = 'blog-' . $i;

            if (isset($blogOverrides['slug'])) {
                $domainOrPath = $blogOverrides['slug'];
                unset($blogOverrides['slug']);
            }

            $blogIds[] = $this->haveBlogInDatabase($domainOrPath, $blogOverrides, $subdomain);
        }

        return $blogIds;
    }
public function haveManyBlogsInDatabase ( $ count , array $ overrides = [ ] , $ subdomain = true ) { $ blogIds = [ ] ; $ overrides = $ this -> setTemplateData ( $ overrides ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ blogOverrides = $ this -> replaceNumbersInArray ( $ overrides , $ i ) ; $ domainOrPath = 'blog-' . $ i ; if ( isset ( $ blogOverrides [ 'slug' ] ) ) { $ domainOrPath = $ blogOverrides [ 'slug' ] ; unset ( $ blogOverrides [ 'slug' ] ) ; } $ blogIds [ ] = $ this -> haveBlogInDatabase ( $ domainOrPath , $ blogOverrides , $ subdomain ) ; } return $ blogIds ; }
Inserts many blogs in the database.

@example
```php
$blogIds = $I->haveManyBlogsInDatabase(3, ['domain' =>'test-{{n}}']);
foreach($blogIds as $blogId){
$I->useBlog($blogId);
$I->haveManuPostsInDatabase(3);
}
```

@param int   $count     The number of blogs to create.
@param array $overrides An array of values to override the default ones; `{{n}}` will be replaced by the count.
@param bool  $subdomain Whether the new blogs should be created as a subdomain or subfolder.

@return array An array of inserted blogs `blog_id`s.
Inserts many blogs in the database .