Skip to content
Permalink
Browse files

Making test more clear and re-adding missing junction conditions in s…

…ubquery

for `notMatching`
  • Loading branch information...
lorenzo committed Jun 26, 2016
1 parent 344317d commit 288781c034c5b33ffb408471238cf58eff7674fb
Showing with 5 additions and 3 deletions.
  1. +2 −1 src/ORM/Association/BelongsToMany.php
  2. +3 −2 tests/TestCase/ORM/QueryTest.php
@@ -378,7 +378,8 @@ protected function _appendNotMatching($query, $options)
$subquery = $this->find()
->select(array_values($conds))
->where($options['conditions']);
->where($options['conditions'])
->andWhere($this->junctionConditions());
$subquery = $options['queryBuilder']($subquery);
@@ -2995,7 +2995,8 @@ public function testLeftJoinWithNested()
->find()
->select([
'authors.id',
'total_articles' => 'count(tags.id)'])
'tagged_articles' => 'count(tags.id)'
])
->leftJoinWith('articles.tags', function ($q) {
return $q->where(['tags.name' => 'tag3']);
})
@@ -3007,7 +3008,7 @@ public function testLeftJoinWithNested()
3 => 1,
4 => 0
];
$this->assertEquals($expected, $results->combine('id', 'total_articles')->toArray());
$this->assertEquals($expected, $results->combine('id', 'tagged_articles')->toArray());
}
/**

0 comments on commit 288781c

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