MINOR Added DataObjectDecoratorTest->testPopulateDefaults()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73132 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-03-16 13:47:52 +00:00
parent 88359b1ba5
commit 76c114f270

View File

@ -56,6 +56,15 @@ class DataObjectDecoratorTest extends SapphireTest {
}
function testPopulateDefaults() {
$obj = new DataObjectDecoratorTest_Member();
$this->assertEquals(
$obj->Phone,
'123',
'Defaults can be populated through decorator'
);
}
}
class DataObjectDecoratorTest_Member extends DataObject implements TestOnly {
@ -77,6 +86,9 @@ class DataObjectDecoratorTest_ContactRole extends DataObjectDecorator implements
),
'has_many' => array(
'RelatedObjects' => 'DataObjectDecoratorTest_RelatedObject'
),
'defaults' => array(
'Phone' => '123'
)
);
}