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:
nate 2007-08-13 20:59:49 +00:00
parent 9d77d85ce4
commit 1911b1d7a5
2 changed files with 22 additions and 3 deletions

View file

@ -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() {