Skip to content

Commit

Permalink
Adding failing test to prove #5081
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Nov 5, 2014
1 parent 135921a commit 8533409
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/TestCase/ORM/QueryRegressionTest.php
Expand Up @@ -502,4 +502,23 @@ public function testContainNoEmptyAssociatedObjects() {
$this->assertNull($result->user, 'No record should be null.');
}

/**
* Tests that using a comparison expression inside an OR condition works
*
* @see https://github.com/cakephp/cakephp/issues/5081
* @return void
*/
public function testOrConditionsWithExpression() {
$table = TableRegistry::get('Articles');
$query = $table->find();
$query->where([
'OR' => [
new \Cake\Database\Expression\Comparison('id', 1, 'integer', '>')
]
]);

$results = $query->toArray();
$this->assertCount(3, $results);
}

}

0 comments on commit 8533409

Please sign in to comment.