public function testMarkToCharNoGuessSuccess()
 {
     $guesser = new ezcDocumentListBulletGuesser();
     $expectedResult = 'a';
     $actualResult = $guesser->markToChar('a');
     self::assertEquals($expectedResult, $actualResult, 'Bullet "a" converted incorrect.');
 }
Пример #2
0
 /**
  * Detects the list bullet to be used and applies a special PCSS setting 
  * for it.
  *
  * This method tries to detect the list bullet to be used for bullet-lists 
  * and sets the special "list-bullet" PCSS property. The new $styles array 
  * is returned. Note: "list-bullet" is not a standard CSS property and 
  * therefore not supported by any other application using CSS. It is also 
  * possible that this property name changes in future.
  * 
  * @param DOMElement $docBookElement 
  * @param array $styles 
  * @return array
  */
 protected function processListBullet(DOMElement $docBookElement, array $styles)
 {
     if (!isset($styles['list-bullet'])) {
         if ($docBookElement->hasAttribute('mark')) {
             $styles['list-bullet'] = new ezcDocumentPcssStyleStringValue($this->bulletGuesser->markToChar($docBookElement->getAttribute('mark')));
         } else {
             if (isset($styles['list-style-type'])) {
                 $styles['list-bullet'] = new ezcDocumentPcssStyleStringValue($this->bulletGuesser->markToChar($styles['list-style-type']->value));
             } else {
                 $styles['list-bullet'] = new ezcDocumentPcssStyleStringValue('⚫');
             }
         }
     }
     return $styles;
 }