PHPWord/tests/PhpWordTests/Style/ListItemTest.php

78 lines
2.0 KiB
PHP
Raw Normal View History

<?php
2014-03-27 23:55:06 +07: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
*
* @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;
/**
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
*
* @runTestsInSeparateProcesses
*/
class ListItemTest extends \PHPUnit\Framework\TestCase
{
/**
2022-09-16 11:45:45 +02:00
* Test construct.
*/
2022-09-16 11:45:45 +02:00
public function testConstruct(): void
{
$object = new ListItem();
$value = ListItem::TYPE_BULLET_FILLED;
2022-09-16 11:45:45 +02:00
self::assertEquals($value, $object->getListType());
}
/**
2022-09-16 11:45:45 +02:00
* Test set style value.
*/
2022-09-16 11:45:45 +02:00
public function testSetStyleValue(): void
{
$object = new ListItem();
$value = ListItem::TYPE_ALPHANUM;
$object->setStyleValue('listType', $value);
2022-09-16 11:45:45 +02:00
self::assertEquals($value, $object->getListType());
}
/**
2022-09-16 11:45:45 +02:00
* Test list type.
*/
2022-09-16 11:45:45 +02:00
public function testListType(): void
{
$object = new ListItem();
$value = ListItem::TYPE_ALPHANUM;
$object->setListType($value);
2022-09-16 11:45:45 +02:00
self::assertEquals($value, $object->getListType());
}
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
}
}