public function testAddOverriddenSmiley()
 {
     $collection = new EmoticonCollection();
     $emoticon = new Emoticon();
     $emoticon->setSmilies(array(':foo:', ':foofoo:'));
     $emoticon1 = new Emoticon();
     $emoticon1->setSmilies(array(':foo:', ':bar:'));
     $collection->add('foo', $emoticon);
     $collection->add('bar', $emoticon1);
     $this->assertSame(array(':foofoo:', ':foo:', ':bar:'), $collection->getSmilies());
     $this->assertSame($emoticon, $collection->getEmoticonBySmiley(':foofoo:'));
     $this->assertSame($emoticon1, $collection->getEmoticonBySmiley(':foo:'));
     $this->assertSame($emoticon1, $collection->getEmoticonBySmiley(':bar:'));
 }
Beispiel #2
0
 /**
  * Returns all smilies.
  *
  * @return string[] An array of smilies
  */
 public function getSmilies()
 {
     return $this->emoticons->getSmilies();
 }