src/Codeception/Module/WPDb.php
public function seeUserInDatabase(array $criteria)
    {
        $tableName = $this->grabPrefixedTableNameFor('users');
        $allCriteria = $criteria;
        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);
            $this->assertTrue(
                $passwordOk,
                'No matching records found for criteria ' . json_encode($allCriteria) . ' in table ' . $tableName
            );
        }
        $this->seeInDatabase($tableName, $criteria);
    }
public function seeUserInDatabase(array $criteria)
    {
        $tableName = $this->grabPrefixedTableNameFor('users');
        $allCriteria = $criteria;
        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);
            $this->assertTrue(
                $passwordOk,
                'No matching records found for criteria ' . json_encode($allCriteria) . ' in table ' . $tableName
            );
        }
        $this->seeInDatabase($tableName, $criteria);
    }
public function seeUserInDatabase ( array $ criteria ) { $ tableName = $ this -> grabPrefixedTableNameFor ( 'users' ) ; $ allCriteria = $ criteria ; 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 ) ; $ this -> assertTrue ( $ passwordOk , 'No matching records found for criteria ' . json_encode ( $ allCriteria ) . ' in table ' . $ tableName ) ; } $ this -> seeInDatabase ( $ tableName , $ criteria ) ; }
Checks that a user is in the database.

The method will check the "users" table.

@example
```php
$userId = $I->haveUserInDatabase(['])
```

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