Beispiel #1
0
 public function testAll()
 {
     $paging = new CM_Paging_Emoticon_All();
     /** @var CM_Emoticon $emoticonFromPaging */
     $emoticonFromPaging = $paging->getItem(0);
     $this->assertInstanceOf('CM_Emoticon', $emoticonFromPaging);
     $emoticonRegular = new CM_Emoticon($emoticonFromPaging->getName());
     $this->assertEquals($emoticonFromPaging, $emoticonRegular);
 }
Beispiel #2
0
 /**
  * @return array
  */
 private function _getEmoticonAdditionalCodesMapping()
 {
     $paging = new CM_Paging_Emoticon_All();
     $emoticonList = $paging->getItems();
     $filteredEmoticonList = \Functional\filter($emoticonList, function (CM_Emoticon $emoticon) {
         return count($emoticon->getCodes()) > 1;
     });
     $mapping = [];
     /** @var CM_Emoticon $emoticon */
     foreach ($filteredEmoticonList as $emoticon) {
         $codeList = $emoticon->getCodes();
         $defaultCode = $emoticon->getDefaultCode();
         foreach ($codeList as $code) {
             if ($code !== $defaultCode) {
                 $mapping[$code] = $defaultCode;
             }
         }
     }
     return $mapping;
 }