Navigation Menu

Skip to content

Commit

Permalink
adding sort on testresults, to avoid incorrect order returned by MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Nov 15, 2011
1 parent bc5b6f7 commit 9fd0430
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/Cake/Test/Case/Model/ModelWriteTest.php
Expand Up @@ -1662,6 +1662,7 @@ public function testSaveHabtmNoPrimaryData() {
$TestModel->id = 2;
$TestModel->save($data);
$result = $TestModel->findById(2);
$result['Item'] = Set::sort($result['Item'], '{n}.id', 'asc');
$expected = array(
'Portfolio' => array(
'id' => 2,
Expand All @@ -1670,24 +1671,24 @@ public function testSaveHabtmNoPrimaryData() {
),
'Item' => array(
array(
'id' => 2,
'syfile_id' => 2,
'id' => 1,
'syfile_id' => 1,
'published' => '',
'name' => 'Item 2',
'name' => 'Item 1',
'ItemsPortfolio' => array(
'id' => 8,
'item_id' => 2,
'id' => 7,
'item_id' => 1,
'portfolio_id' => 2
)
),
array(
'id' => 1,
'syfile_id' => 1,
'id' => 2,
'syfile_id' => 2,
'published' => '',
'name' => 'Item 1',
'name' => 'Item 2',
'ItemsPortfolio' => array(
'id' => 7,
'item_id' => 1,
'id' => 8,
'item_id' => 2,
'portfolio_id' => 2
)
)
Expand Down

0 comments on commit 9fd0430

Please sign in to comment.