Skip to content

Commit

Permalink
Fix Dbh module seeInDatabase or dontSeeInDatabase with empty criteria. (
Browse files Browse the repository at this point in the history
#3117)

Fixes #3116
  • Loading branch information
raistlin authored and DavertMik committed May 21, 2016
1 parent 5ff2eb4 commit e56823a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

#### 2.1.9

* [Dbh] Fix seeInDatabase and dontSeeInDatabase with empty criteria. Closes #3116
* [Symfony] Improve fail messages on seeInCurrentRoute and seeCurrentRouteIs
* [Symfony] Improve route comparison on seeInCurrentRoute and seeCurrentRouteIs
* [WebDriver] multi session testing with friends improved by @eXorus. Webdriver sessions are finished correctly; `leave()` method added to Friend class. See #3068
Expand Down
6 changes: 5 additions & 1 deletion src/Codeception/Module/Dbh.php
Expand Up @@ -113,7 +113,11 @@ protected function proceedSeeInDatabase($table, $column, $criteria)
}
$sparams = implode('AND ', $params);

$query = sprintf('select %s from %s where %s', $column, $table, $sparams);
if (empty($sparams)) {
$query = sprintf('select %s from %s', $column, $table);
} else {
$query = sprintf('select %s from %s where %s', $column, $table, $sparams);
}

$this->debugSection('Query', $query, $sparams);

Expand Down

0 comments on commit e56823a

Please sign in to comment.