ENHANCEMENT Added unittest to TagFieldTest->testValueDisplayFromRelation()

This commit is contained in:
chillu 2008-10-09 00:33:27 +00:00
parent 318f7ac777
commit b87158fa0b
1 changed files with 14 additions and 0 deletions

View File

@ -137,6 +137,20 @@ class TagFieldTest extends FunctionalTest {
$this->assertEquals($field->suggest($request), '[]');
}
function testValueDisplayFromRelation() {
$form = new Form(
$this,
'Form',
new FieldSet(
$field = new TagField('Tags', null, null, 'TagFieldTest_BlogEntry')
),
new FieldSet()
);
$existingEntry = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry1');
$form->loadDataFrom($existingEntry);
$this->assertEquals($field->Value(), 'tag1 tag2', 'Correctly displays saved relationships');
}
}
class TagFieldTest_Tag extends DataObject implements TestOnly {