public function testColumn()
 {
     $object = new UnsavedRelationListTest_DataObject();
     $children = $object->Children();
     $children->add(new UnsavedRelationListTest_DataObject(array('Name' => 'A')));
     $children->add(new UnsavedRelationListTest_DataObject(array('Name' => 'B')));
     $children->add(new UnsavedRelationListTest_DataObject(array('Name' => 'C')));
     $children = $object->Children();
     $this->assertDOSEquals(array(array('Name' => 'A'), array('Name' => 'B'), array('Name' => 'C')), $children);
     $this->assertEquals($children->column('Name'), array('A', 'B', 'C'));
 }
 public function testGetIDList()
 {
     $object = new UnsavedRelationListTest_DataObject();
     $children = $object->Children();
     $this->assertEquals($children->getIDList(), array());
     $children->add($child1 = new UnsavedRelationListTest_DataObject(array('Name' => 'A')));
     $children->add($child2 = new UnsavedRelationListTest_DataObject(array('Name' => 'B')));
     $children->add($child3 = new UnsavedRelationListTest_DataObject(array('Name' => 'C')));
     $children->add($child1);
     $this->assertEquals($children->getIDList(), array());
     $child1->write();
     $this->assertEquals($children->getIDList(), array($child1->ID => $child1->ID));
     $child2->write();
     $child3->write();
     $this->assertEquals($children->getIDList(), array($child1->ID => $child1->ID, $child2->ID => $child2->ID, $child3->ID => $child3->ID));
 }