mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
88359b1ba5
commit
76c114f270
@ -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 {
|
class DataObjectDecoratorTest_Member extends DataObject implements TestOnly {
|
||||||
@ -77,6 +86,9 @@ class DataObjectDecoratorTest_ContactRole extends DataObjectDecorator implements
|
|||||||
),
|
),
|
||||||
'has_many' => array(
|
'has_many' => array(
|
||||||
'RelatedObjects' => 'DataObjectDecoratorTest_RelatedObject'
|
'RelatedObjects' => 'DataObjectDecoratorTest_RelatedObject'
|
||||||
|
),
|
||||||
|
'defaults' => array(
|
||||||
|
'Phone' => '123'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user