mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 04:22:40 +00:00
Implementing custom array value formatting in Set::combine() and Model::generateList()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5518 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
9d77d85ce4
commit
1911b1d7a5
2 changed files with 22 additions and 3 deletions
|
@ -437,6 +437,16 @@ class SetTest extends UnitTestCase {
|
|||
)
|
||||
);
|
||||
$this->assertIdentical($result, $expected);
|
||||
|
||||
$result = Set::combine($a, '{n}.User.id', array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.group_id');
|
||||
$expected = array (
|
||||
1 => array (
|
||||
2 => 'mariano.iglesias: Mariano Iglesias',
|
||||
25 => 'gwoo: The Gwoo'
|
||||
),
|
||||
2 => array (14 => 'phpnut: Larry E. Masters')
|
||||
);
|
||||
$this->assertIdentical($result, $expected);
|
||||
}
|
||||
|
||||
function testMapReverse() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue