Skip to content
Permalink
Browse files

Fix tests for postgres.

Identifier quoting rules are a pain in postgres.
  • Loading branch information...
markstory committed Aug 22, 2015
1 parent c61c408 commit bbb829a2a7cc8715fdbf2ea51afc77ad3d3c47ac
Showing with 7 additions and 5 deletions.
  1. +7 −5 tests/TestCase/ORM/QueryTest.php
@@ -1473,8 +1473,10 @@ public function testCountWithSubselect()
$counter->select([
'total' => $counter->func()->count('*')
])
->where(['ArticlesTags.tag_id' => 1])
->where(['ArticlesTags.article_id = Articles.id']);
->where([
'ArticlesTags.tag_id' => 1,
'ArticlesTags.article_id' => new IdentifierExpression('Articles.id')
]);
$result = $table->find('all')
->select([
@@ -1498,12 +1500,12 @@ public function testCountWithExpressions()
$table = TableRegistry::get('Articles');
$query = $table->find();
$query->select([
'admin' => $query->func()->concat(
['Articles.title' => 'literal', 'test'],
'title' => $query->func()->concat(
['title' => 'literal', 'test'],
['string']
),
]);
$query->where(['Articles.id' => 1]);
$query->where(['id' => 1]);
$this->assertCount(1, $query->all());
$this->assertEquals(1, $query->count());
}

0 comments on commit bbb829a

Please sign in to comment.
You can’t perform that action at this time.