2014-03-09 19:09:22 +01:00
|
|
|
<?php
|
2014-03-20 16:54:12 +04:00
|
|
|
namespace PhpWord\Tests\Section;
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-18 17:26:03 +04:00
|
|
|
use PhpOffice\PhpWord\Section\ListItem;
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-09 15:04:23 -04:00
|
|
|
class ListItemTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
public function testText()
|
|
|
|
|
{
|
2014-03-18 17:26:03 +04:00
|
|
|
$oListItem = new ListItem('text');
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-18 17:26:03 +04:00
|
|
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\Section\\Text', $oListItem->getTextObject());
|
2014-03-09 15:04:23 -04:00
|
|
|
}
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-09 15:04:23 -04:00
|
|
|
public function testStyle()
|
|
|
|
|
{
|
2014-03-18 17:26:03 +04:00
|
|
|
$oListItem = new ListItem(
|
2014-03-12 13:30:02 +07:00
|
|
|
'text',
|
|
|
|
|
1,
|
|
|
|
|
null,
|
2014-03-18 17:26:03 +04:00
|
|
|
array('listType' => PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER)
|
2014-03-12 13:30:02 +07:00
|
|
|
);
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-18 17:26:03 +04:00
|
|
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\ListItem', $oListItem->getStyle());
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
$oListItem->getStyle()->getListType(),
|
|
|
|
|
PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER
|
|
|
|
|
);
|
2014-03-09 15:04:23 -04:00
|
|
|
}
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-09 15:04:23 -04:00
|
|
|
public function testDepth()
|
|
|
|
|
{
|
|
|
|
|
$iVal = rand(1, 1000);
|
2014-03-18 17:26:03 +04:00
|
|
|
$oListItem = new ListItem('text', $iVal);
|
2014-03-09 19:09:22 +01:00
|
|
|
|
2014-03-09 15:04:23 -04:00
|
|
|
$this->assertEquals($oListItem->getDepth(), $iVal);
|
|
|
|
|
}
|
2014-03-18 17:26:03 +04:00
|
|
|
}
|