Skip to content

Commit

Permalink
Fixed a couple local problems with order of results in mysql tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Nov 9, 2014
1 parent 0277c3f commit 76ebe3a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/TestCase/Model/Behavior/TranslateBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ public function testFindSingleLocaleAssociatedEnv() {

$results = $table->find()
->select(['id', 'title', 'body'])
->contain(['Comments' => ['fields' => ['article_id', 'comment']]])
->contain([
'Comments' => [
'fields' => ['article_id', 'comment'],
'sort' => ['Comments.id' => 'ASC']
]
])
->hydrate(false)
->toArray();

Expand Down Expand Up @@ -806,7 +811,7 @@ public function testTranslationWithUnionQuery() {
$query = $table->find()->where(['Comments.id' => 6]);
$query2 = $table->find()->where(['Comments.id' => 5]);
$query->union($query2);
$results = $query->toArray();
$results = $query->sortBy('id')->toArray();
$this->assertCount(2, $results);

$this->assertEquals('First Comment for Second Article', $results[0]->comment);
Expand Down

0 comments on commit 76ebe3a

Please sign in to comment.