silverstripe-framework/tests/ArrayDataTest.php
Sam Minnee a99accbea4 ArrayData should only change the type of included objects if they're not ViewableData.
Included regression test

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60473 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-12 03:34:19 +00:00

14 lines
419 B
PHP

<?php
class ArrayDataTest extends SapphireTest {
function testViewabledataItemsInsideArraydataArePreserved() {
/* ViewableData objects will be preserved, but other objects will be converted */
$arrayData = new ArrayData(array(
"A" => new Varchar("A"),
"B" => new Object(),
));
$this->assertEquals("Varchar", get_class($arrayData->A));
$this->assertEquals("ArrayData", get_class($arrayData->B));
}
}