Skip to content
Permalink
Browse files

Add regression test for #7163

  • Loading branch information...
markstory committed Aug 8, 2015
1 parent 05b11a4 commit 9b0c1fc5606ca53116ea2913b5e629c6e7f13d49
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/TestCase/ORM/QueryRegressionTest.php
@@ -1022,4 +1022,26 @@ public function testDotNotationNotOverride()
$this->assertEquals([['name' => 'nate', 'tag' => 'tag1']], $results);
}
/**
* Test expression based ordering with unions.
*
* @return void
*/
public function testComplexOrderWithUnion()
{
$table = TableRegistry::get('Comments');
$query = $table->find();
$inner = $table->find()->where(['id >' => 3]);
$inner2 = $table->find()->where(['id <' => 3]);
$order = $query->func()->concat(['inside__comment' => 'literal', 'test']);
$query->select(['inside__comment' => 'Comments__comment'])
->from(['inside' => $inner->unionAll($inner2)])
->orderAsc($order);
$results = $query->toArray();
$this->assertCount(5, $results);
}
}

0 comments on commit 9b0c1fc

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