src/Codeception/Module/WPDb.php
public function dontHaveBlogInDatabase(array $criteria, $removeTables = true, $removeUploads = true)
    {
        $criteria = $this->prepareBlogCriteria($criteria);

        $blogIds = $this->grabAllFromDatabase($this->grabBlogsTableName(), 'blog_id', $criteria);

        foreach (array_column($blogIds, 'blog_id') as $blogId) {
            if (empty($blogId)) {
                $this->debug('No blog found matching criteria ' . json_encode($criteria, JSON_PRETTY_PRINT));
                return;
            }

            if ($removeTables) {
                foreach ($this->grabBlogTableNames($blogId) as $tableName) {
                    $this->dontHaveTableInDatabase($tableName);
                }
            }

            if ($removeUploads && ($fs = $this->getWpFilesystemModule(false))) {
                $fs->deleteUploadedDir($fs->getBlogUploadsPath($blogId));
            }

            $this->dontHaveInDatabase($this->grabBlogsTableName(), $criteria);
        }
    }
public function dontHaveBlogInDatabase(array $criteria, $removeTables = true, $removeUploads = true)
    {
        $criteria = $this->prepareBlogCriteria($criteria);

        $blogIds = $this->grabAllFromDatabase($this->grabBlogsTableName(), 'blog_id', $criteria);

        foreach (array_column($blogIds, 'blog_id') as $blogId) {
            if (empty($blogId)) {
                $this->debug('No blog found matching criteria ' . json_encode($criteria, JSON_PRETTY_PRINT));
                return;
            }

            if ($removeTables) {
                foreach ($this->grabBlogTableNames($blogId) as $tableName) {
                    $this->dontHaveTableInDatabase($tableName);
                }
            }

            if ($removeUploads && ($fs = $this->getWpFilesystemModule(false))) {
                $fs->deleteUploadedDir($fs->getBlogUploadsPath($blogId));
            }

            $this->dontHaveInDatabase($this->grabBlogsTableName(), $criteria);
        }
    }
public function dontHaveBlogInDatabase ( array $ criteria , $ removeTables = true , $ removeUploads = true ) { $ criteria = $ this -> prepareBlogCriteria ( $ criteria ) ; $ blogIds = $ this -> grabAllFromDatabase ( $ this -> grabBlogsTableName ( ) , 'blog_id' , $ criteria ) ; foreach ( array_column ( $ blogIds , 'blog_id' ) as $ blogId ) { if ( empty ( $ blogId ) ) { $ this -> debug ( 'No blog found matching criteria ' . json_encode ( $ criteria , JSON_PRETTY_PRINT ) ) ; return ; } if ( $ removeTables ) { foreach ( $ this -> grabBlogTableNames ( $ blogId ) as $ tableName ) { $ this -> dontHaveTableInDatabase ( $ tableName ) ; } } if ( $ removeUploads && ( $ fs = $ this -> getWpFilesystemModule ( false ) ) ) { $ fs -> deleteUploadedDir ( $ fs -> getBlogUploadsPath ( $ blogId ) ) ; } $ this -> dontHaveInDatabase ( $ this -> grabBlogsTableName ( ) , $ criteria ) ; } }
Removes one ore more blogs frome the database.

@example
```php
// Remove the blog, all its tables and files.
$I->dontHaveBlogInDatabase(['path' => 'test/one']);
// Remove the blog entry, not the tables though.
$I->dontHaveBlogInDatabase(['blog_id' => $blogId]);
// Remove multiple blogs.
$I->dontHaveBlogInDatabase(['domain' => 'test']);
```

@param array $criteria      An array of search criteria to find the blog rows in the blogs table.
@param bool  $removeTables  Remove the blog tables.
@param bool  $removeUploads Remove the blog uploads; requires the `WPFilesystem` module.
Removes one ore more blogs frome the database .