src/Codeception/Module/WPDb.php
public function dontHavePostInDatabase(array $criteria, $purgeMeta = true)
    {
        $postsTable = $this->grabPrefixedTableNameFor('posts');
        if ($purgeMeta) {
            $id = $this->grabFromDatabase($postsTable, 'ID', $criteria);
            if (!empty($id)) {
                $this->dontHavePostMetaInDatabase(['post_id' => $id]);
            }
        }

        $this->dontHaveInDatabase($postsTable, $criteria);
    }
public function dontHavePostInDatabase(array $criteria, $purgeMeta = true)
    {
        $postsTable = $this->grabPrefixedTableNameFor('posts');
        if ($purgeMeta) {
            $id = $this->grabFromDatabase($postsTable, 'ID', $criteria);
            if (!empty($id)) {
                $this->dontHavePostMetaInDatabase(['post_id' => $id]);
            }
        }

        $this->dontHaveInDatabase($postsTable, $criteria);
    }
public function dontHavePostInDatabase ( array $ criteria , $ purgeMeta = true ) { $ postsTable = $ this -> grabPrefixedTableNameFor ( 'posts' ) ; if ( $ purgeMeta ) { $ id = $ this -> grabFromDatabase ( $ postsTable , 'ID' , $ criteria ) ; if ( ! empty ( $ id ) ) { $ this -> dontHavePostMetaInDatabase ( [ 'post_id' => $ id ] ) ; } } $ this -> dontHaveInDatabase ( $ postsTable , $ criteria ) ; }
Removes an entry from the posts table.

@example
```php
$posts = $I->haveManyPostsInDatabase(3, ['post_title' => 'Test {{n}}']);
$I->dontHavePostInDatabase(['post_title' => 'Test 2']);
```

@param  array $criteria  An array of search criteria.
@param bool   $purgeMeta If set to `true` then the meta for the post will be purged too.
Removes an entry from the posts table .