function testValues() { $list = DataObjectTest_TeamComment::get(); $list->sort('Name'); $map = new SS_Map($list, 'Name', 'Comment'); $this->assertEquals(array('This is a team comment by Bob', 'This is a team comment by Joe', 'Phil is a unique guy, and comments on team2'), $map->values()); }
public function testMethodAsValueField() { $list = DataObjectTest_Team::get()->sort('Title'); $map = new SS_Map($list, 'ID', 'MyTitle'); $this->assertEquals(array('Team Subteam 1', 'Team Subteam 2', 'Team Subteam 3', 'Team Team 1', 'Team Team 2', 'Team Team 3'), $map->values()); }