public function testAddOverriddenEmoticon()
 {
     $collection = new EmoticonCollection();
     $emoticon = new Emoticon();
     $emoticon->setSmilies(array(':foo:'));
     $emoticon1 = new Emoticon();
     $emoticon1->setSmilies(array(':bar:'));
     $emoticon2 = new Emoticon();
     $emoticon2->setSmilies(array(':foofoo:'));
     $collection->add('foo', $emoticon);
     $collection->add('bar', $emoticon1);
     $collection->add('foo', $emoticon2);
     $this->assertSame(array(':foo:', ':bar:', ':foofoo:'), $collection->getSmilies());
     $this->assertSame(array('bar' => $emoticon1, 'foo' => $emoticon2), $collection->all());
     $this->assertSame($emoticon1, $collection->getEmoticonBySmiley(':bar:'));
     $this->assertSame($emoticon, $collection->getEmoticonBySmiley(':foo:'));
     $this->assertSame($emoticon2, $collection->getEmoticonBySmiley(':foofoo:'));
 }
 /**
  * Adds an emoticon collection.
  *
  * @param EmoticonCollection $collection  A EmoticonCollection instance
  */
 public function addCollection(EmoticonCollection $collection)
 {
     foreach ($collection->all() as $name => $emoticon) {
         $this->add($name, $emoticon);
     }
     $this->resources = array_merge($this->resources, $collection->getResources());
 }