mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
adding sort on testresults, to avoid incorrect order returned by MySQL
This commit is contained in:
parent
bc5b6f7cb2
commit
9fd04307ff
1 changed files with 12 additions and 11 deletions
|
@ -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
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue