2014-03-10 03:20:24 +07:00
|
|
|
<?php
|
2014-03-27 23:55:06 +07:00
|
|
|
/**
|
2014-05-05 13:06:53 +04:00
|
|
|
* This file is part of PHPWord - A pure PHP library for reading and writing
|
|
|
|
|
* word processing documents.
|
|
|
|
|
*
|
|
|
|
|
* PHPWord is free software distributed under the terms of the GNU Lesser
|
|
|
|
|
* General Public License version 3 as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* For the full copyright and license information, please read the LICENSE
|
|
|
|
|
* file that was distributed with this source code. For the full list of
|
|
|
|
|
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
|
2014-03-27 23:55:06 +07:00
|
|
|
*
|
2017-11-04 22:44:12 +01:00
|
|
|
* @see https://github.com/PHPOffice/PHPWord
|
2022-09-16 11:45:45 +02:00
|
|
|
*
|
2014-05-04 21:03:28 +04:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
2014-03-27 23:55:06 +07:00
|
|
|
*/
|
|
|
|
|
|
2022-09-16 14:09:17 +02:00
|
|
|
namespace PhpOffice\PhpWordTests\Style;
|
|
|
|
|
|
|
|
|
|
use PhpOffice\PhpWord\Style\ListItem;
|
2014-03-10 03:20:24 +07:00
|
|
|
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test class for PhpOffice\PhpWord\Style\ListItem.
|
2014-03-27 23:55:06 +07:00
|
|
|
*
|
|
|
|
|
* @coversDefaultClass \PhpOffice\PhpWord\Style\ListItem
|
2022-09-16 11:45:45 +02:00
|
|
|
*
|
2014-03-10 03:20:24 +07:00
|
|
|
* @runTestsInSeparateProcesses
|
|
|
|
|
*/
|
2017-11-09 06:36:47 -02:00
|
|
|
class ListItemTest extends \PHPUnit\Framework\TestCase
|
2014-03-10 03:20:24 +07:00
|
|
|
{
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test construct.
|
2014-03-10 03:20:24 +07:00
|
|
|
*/
|
2022-09-16 11:45:45 +02:00
|
|
|
public function testConstruct(): void
|
2014-03-10 03:20:24 +07:00
|
|
|
{
|
2014-03-19 11:04:48 +04:00
|
|
|
$object = new ListItem();
|
2014-03-10 03:20:24 +07:00
|
|
|
|
2014-03-19 11:04:48 +04:00
|
|
|
$value = ListItem::TYPE_BULLET_FILLED;
|
2022-09-16 11:45:45 +02:00
|
|
|
self::assertEquals($value, $object->getListType());
|
2014-03-10 03:20:24 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test set style value.
|
2014-03-10 03:20:24 +07:00
|
|
|
*/
|
2022-09-16 11:45:45 +02:00
|
|
|
public function testSetStyleValue(): void
|
2014-03-10 03:20:24 +07:00
|
|
|
{
|
2014-03-19 11:04:48 +04:00
|
|
|
$object = new ListItem();
|
2014-03-10 03:20:24 +07:00
|
|
|
|
2014-03-19 11:04:48 +04:00
|
|
|
$value = ListItem::TYPE_ALPHANUM;
|
2014-04-06 18:03:03 +07:00
|
|
|
$object->setStyleValue('listType', $value);
|
2022-09-16 11:45:45 +02:00
|
|
|
self::assertEquals($value, $object->getListType());
|
2014-03-10 03:20:24 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test list type.
|
2014-03-10 03:20:24 +07:00
|
|
|
*/
|
2022-09-16 11:45:45 +02:00
|
|
|
public function testListType(): void
|
2014-03-10 03:20:24 +07:00
|
|
|
{
|
2014-03-19 11:04:48 +04:00
|
|
|
$object = new ListItem();
|
2014-03-10 03:20:24 +07:00
|
|
|
|
2014-03-19 11:04:48 +04:00
|
|
|
$value = ListItem::TYPE_ALPHANUM;
|
2014-03-10 03:20:24 +07:00
|
|
|
$object->setListType($value);
|
2022-09-16 11:45:45 +02:00
|
|
|
self::assertEquals($value, $object->getListType());
|
2014-03-10 03:20:24 +07:00
|
|
|
}
|
2014-04-12 12:57:51 +07:00
|
|
|
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test set/get numbering style name.
|
2014-04-12 12:57:51 +07:00
|
|
|
*/
|
2022-09-16 11:45:45 +02:00
|
|
|
public function testSetGetNumStyle(): void
|
2014-04-12 12:57:51 +07:00
|
|
|
{
|
|
|
|
|
$expected = 'List Name';
|
|
|
|
|
|
|
|
|
|
$object = new ListItem();
|
|
|
|
|
$object->setNumStyle($expected);
|
2022-09-16 11:45:45 +02:00
|
|
|
self::assertEquals($expected, $object->getNumStyle());
|
2014-04-12 12:57:51 +07:00
|
|
|
}
|
2014-03-11 21:44:54 +07:00
|
|
|
}
|