Skip to content

Commit

Permalink
Fix failing tests and PHPCS errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 11, 2014
1 parent d1ec92f commit c68ec84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Database/SqlDialectTrait.php
Expand Up @@ -131,6 +131,7 @@ protected function _transformDistinct($query) {
}
return $query;
}

/**
*
* Apply translation steps to delete queries.
Expand Down Expand Up @@ -162,7 +163,7 @@ protected function _deleteQueryTranslator($query) {
}
$conditions = $query->clause('where');
if ($conditions) {
$conditions->iterateParts(function($condition, $key) {
$conditions->traverse(function($condition) {
if (!($condition instanceof Comparison)) {
return $condition;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Database/QueryTest.php
Expand Up @@ -1894,10 +1894,10 @@ public function testDeleteWithAliasedFrom() {

$query->delete()
->from(['a ' => 'authors'])
->where(['a.id <' => 99]);
->where(['a.id !=' => 99]);

$result = $query->sql();
$this->assertQuotedQuery('DELETE <a> FROM <authors> AS <a>', $result, true);
$this->assertQuotedQuery('DELETE FROM <authors> WHERE <id> != :c0', $result, true);

$result = $query->execute();
$this->assertInstanceOf('Cake\Database\StatementInterface', $result);
Expand Down

0 comments on commit c68ec84

Please sign in to comment.