Esempio n. 1
0
 public function testIsEmpty()
 {
     $emptyGroup = new AliasGroup('en');
     $this->assertTrue($emptyGroup->isEmpty());
     $filledGroup = new AliasGroup('en', array('foo'));
     $this->assertFalse($filledGroup->isEmpty());
 }
Esempio n. 2
0
 /**
  * If the group is empty, it will not be stored.
  * In case the language of that group had an associated group, that group will be removed.
  *
  * @param AliasGroup $group
  */
 public function setGroup(AliasGroup $group)
 {
     if ($group->isEmpty()) {
         unset($this->groups[$group->getLanguageCode()]);
     } else {
         $this->groups[$group->getLanguageCode()] = $group;
     }
 }