mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
tests for regression in Set::sort(), re: #2673
This commit is contained in:
parent
3b1bd90ad6
commit
beb0474d67
1 changed files with 13 additions and 0 deletions
|
@ -363,6 +363,19 @@ class SetTest extends CakeTestCase {
|
|||
array('employees' => array(array('name' => array())))
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$menus = array(
|
||||
'blogs' => array('title' => 'Blogs', 'weight' => 3),
|
||||
'comments' => array('title' => 'Comments', 'weight' => 2),
|
||||
'users' => array('title' => 'Users', 'weight' => 1),
|
||||
);
|
||||
$expected = array(
|
||||
'users' => array('title' => 'Users', 'weight' => 1),
|
||||
'comments' => array('title' => 'Comments', 'weight' => 2),
|
||||
'blogs' => array('title' => 'Blogs', 'weight' => 3),
|
||||
);
|
||||
$result = Set::sort($menus, '{[a-z]+}.weight', 'ASC');
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue