src/Codeception/Module/WPDb.php
public function dontSeeUserInDatabase(array $criteria)
    {
        $tableName = $this->grabPrefixedTableNameFor('users');
        $allCriteria = $criteria;
        $passwordOk = false;
        if (!empty($criteria['user_pass'])) {
            $userPass = $criteria['user_pass'];
            unset($criteria['user_pass']);
            $hashedPass = $this->grabFromDatabase($tableName, 'user_pass', [$criteria]);
            $passwordOk = WpPassword::instance()->check($userPass, $hashedPass);
        }

        $count = $this->countInDatabase($tableName, $criteria);
        $this->assertTrue(
            !$passwordOk && $count < 1,
            'Unexpectedly found matching records for criteria ' . json_encode($allCriteria) . ' in table ' . $tableName
        );
    }
public function dontSeeUserInDatabase(array $criteria)
    {
        $tableName = $this->grabPrefixedTableNameFor('users');
        $allCriteria = $criteria;
        $passwordOk = false;
        if (!empty($criteria['user_pass'])) {
            $userPass = $criteria['user_pass'];
            unset($criteria['user_pass']);
            $hashedPass = $this->grabFromDatabase($tableName, 'user_pass', [$criteria]);
            $passwordOk = WpPassword::instance()->check($userPass, $hashedPass);
        }

        $count = $this->countInDatabase($tableName, $criteria);
        $this->assertTrue(
            !$passwordOk && $count < 1,
            'Unexpectedly found matching records for criteria ' . json_encode($allCriteria) . ' in table ' . $tableName
        );
    }
public function dontSeeUserInDatabase ( array $ criteria ) { $ tableName = $ this -> grabPrefixedTableNameFor ( 'users' ) ; $ allCriteria = $ criteria ; $ passwordOk = false ; if ( ! empty ( $ criteria [ 'user_pass' ] ) ) { $ userPass = $ criteria [ 'user_pass' ] ; unset ( $ criteria [ 'user_pass' ] ) ; $ hashedPass = $ this -> grabFromDatabase ( $ tableName , 'user_pass' , [ $ criteria ] ) ; $ passwordOk = WpPassword :: instance ( ) -> check ( $ userPass , $ hashedPass ) ; } $ count = $ this -> countInDatabase ( $ tableName , $ criteria ) ; $ this -> assertTrue ( ! $ passwordOk && $ count < 1 , 'Unexpectedly found matching records for criteria ' . json_encode ( $ allCriteria ) . ' in table ' . $ tableName ) ; }
Checks that a user is not in the database.

@example
```php
// Asserts a user does not exist in the database.
$I->dontSeeUserInDatabase(['user_login' => 'luca']);
// Asserts a user with email and login is not in the database.
$I->dontSeeUserInDatabase(['user_login' => 'luca', 'user_email' => 'luca@theaveragedev.com']);
```

@param  array $criteria An array of search criteria.
Checks that a user is not in the database .