adding sort on testresults, to avoid incorrect order returned by MySQL

This commit is contained in:
Ceeram 2011-11-15 17:18:27 +01:00
parent bc5b6f7cb2
commit 9fd04307ff

View file

@ -1662,6 +1662,7 @@ class ModelWriteTest extends BaseModelTest {
$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,
@ -1669,17 +1670,6 @@ class ModelWriteTest extends BaseModelTest {
'name' => 'Portfolio 2'
),
'Item' => array(
array(
'id' => 2,
'syfile_id' => 2,
'published' => '',
'name' => 'Item 2',
'ItemsPortfolio' => array(
'id' => 8,
'item_id' => 2,
'portfolio_id' => 2
)
),
array(
'id' => 1,
'syfile_id' => 1,
@ -1690,6 +1680,17 @@ class ModelWriteTest extends BaseModelTest {
'item_id' => 1,
'portfolio_id' => 2
)
),
array(
'id' => 2,
'syfile_id' => 2,
'published' => '',
'name' => 'Item 2',
'ItemsPortfolio' => array(
'id' => 8,
'item_id' => 2,
'portfolio_id' => 2
)
)
)
);