Ejemplo n.º 1
1
 /**
  * Add listitem element
  *
  * @param string $text
  * @param int $depth
  * @param mixed $fontStyle
  * @param mixed $styleList
  * @param mixed $paragraphStyle
  * @return ListItem
  */
 public function addListItem($text, $depth = 0, $fontStyle = null, $styleList = null, $paragraphStyle = null)
 {
     $this->checkValidity('listitem');
     $listItem = new ListItem(String::toUTF8($text), $depth, $fontStyle, $styleList, $paragraphStyle);
     $listItem->setDocPart($this->getDocPart(), $this->getDocPartId());
     $this->addElement($listItem);
     return $listItem;
 }
Ejemplo n.º 2
0
 /**
  * Get depth
  */
 public function testDepth()
 {
     $iVal = rand(1, 1000);
     $oListItem = new ListItem(htmlspecialchars('text', ENT_COMPAT, 'UTF-8'), $iVal);
     $this->assertEquals($iVal, $oListItem->getDepth());
 }
Ejemplo n.º 3
0
 /**
  * Get depth
  */
 public function testDepth()
 {
     $iVal = rand(1, 1000);
     $oListItem = new ListItem('text', $iVal);
     $this->assertEquals($oListItem->getDepth(), $iVal);
 }