Example #1
0
 public function testGetGroup()
 {
     $list = array('Models' => array('1' => 'Foo', '2' => 'Bar'), 'Mitarbeiter' => array('3' => 'Some', '4' => 'Thing'));
     $matching = array('Models' => 'Model', 'Mitarbeiter' => 'Contributor');
     $res = CommonComponent::getGroup($list, 111);
     $this->assertEquals('', $res);
     $res = CommonComponent::getGroup($list, 2);
     $this->assertEquals('Models', $res);
     $res = CommonComponent::getGroup($list, 2, $matching);
     $this->assertEquals('Model', $res);
     $res = CommonComponent::getGroup($list, 3, $matching);
     $this->assertEquals('Contributor', $res);
 }