silverstripe-framework/tests/ArrayLibTest.php
Ingo Schommer 94216da276 MINOR Documented and unit tested ArrayLib::invert() (merged from branches/2.3-nzct)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82068 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-17 00:01:06 +00:00

33 lines
505 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class ArrayLibTest extends SapphireTest {
function testInvert() {
$arr = array(
'row1' => array(
'col1' =>'val1',
'col2' => 'val2'
),
'row2' => array(
'col1' => 'val3',
'col2' => 'val4'
)
);
$this->assertEquals(
ArrayLib::invert($arr),
array(
'col1' => array(
'row1' => 'val1',
'row2' => 'val3',
),
'col2' => array(
'row1' => 'val2',
'row2' => 'val4',
),
)
);
}
}