Browse Source

Fix failing tests and PHPCS errors.

mark_story 11 years ago
parent
commit
c68ec84020
2 changed files with 4 additions and 3 deletions
  1. 2 1
      src/Database/SqlDialectTrait.php
  2. 2 2
      tests/TestCase/Database/QueryTest.php

+ 2 - 1
src/Database/SqlDialectTrait.php

@@ -131,6 +131,7 @@ trait SqlDialectTrait {
 		}
 		return $query;
 	}
+
 /**
  *
  * Apply translation steps to delete queries.
@@ -162,7 +163,7 @@ trait SqlDialectTrait {
 		}
 		$conditions = $query->clause('where');
 		if ($conditions) {
-			$conditions->iterateParts(function($condition, $key) {
+			$conditions->traverse(function($condition) {
 				if (!($condition instanceof Comparison)) {
 					return $condition;
 				}

+ 2 - 2
tests/TestCase/Database/QueryTest.php

@@ -1894,10 +1894,10 @@ class QueryTest extends TestCase {
 
 		$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);