2014-04-11 21:16:07 +07:00
|
|
|
<?php
|
|
|
|
|
/**
|
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-04-11 21:16:07 +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-04-11 21:16:07 +07:00
|
|
|
*/
|
|
|
|
|
|
2022-09-16 14:09:17 +02:00
|
|
|
namespace PhpOffice\PhpWordTests\Style;
|
2014-04-11 21:16:07 +07:00
|
|
|
|
2015-10-10 19:22:19 +04:00
|
|
|
use PhpOffice\PhpWord\SimpleType\Jc;
|
2022-09-16 14:09:17 +02:00
|
|
|
use PhpOffice\PhpWord\Style\NumberingLevel;
|
2014-04-11 21:16:07 +07:00
|
|
|
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test class for PhpOffice\PhpWord\Style\NumberingLevel.
|
2014-04-11 21:16:07 +07:00
|
|
|
*
|
|
|
|
|
* @runTestsInSeparateProcesses
|
|
|
|
|
*/
|
2017-11-09 06:36:47 -02:00
|
|
|
class NumberingLevelTest extends \PHPUnit\Framework\TestCase
|
2014-04-11 21:16:07 +07:00
|
|
|
{
|
|
|
|
|
/**
|
2022-09-16 11:45:45 +02:00
|
|
|
* Test setting style with normal value.
|
2014-04-11 21:16:07 +07:00
|
|
|
*/
|
2022-09-16 11:45:45 +02:00
|
|
|
public function testSetGetNormal(): void
|
2014-04-11 21:16:07 +07:00
|
|
|
{
|
|
|
|
|
$object = new NumberingLevel();
|
|
|
|
|
|
2022-09-16 11:45:45 +02:00
|
|
|
$attributes = [
|
|
|
|
|
'level' => 1,
|
|
|
|
|
'start' => 1,
|
|
|
|
|
'format' => 'decimal',
|
|
|
|
|
'restart' => 1,
|
|
|
|
|
'pStyle' => 'pStyle',
|
|
|
|
|
'suffix' => 'space',
|
|
|
|
|
'text' => '%1.',
|
2015-10-10 19:22:19 +04:00
|
|
|
'alignment' => Jc::START,
|
2022-09-16 11:45:45 +02:00
|
|
|
'left' => 360,
|
|
|
|
|
'hanging' => 360,
|
|
|
|
|
'tabPos' => 360,
|
|
|
|
|
'font' => 'Arial',
|
|
|
|
|
'hint' => 'default',
|
|
|
|
|
];
|
2014-04-11 21:16:07 +07:00
|
|
|
foreach ($attributes as $key => $value) {
|
|
|
|
|
$set = "set{$key}";
|
|
|
|
|
$get = "get{$key}";
|
|
|
|
|
$object->$set($value);
|
2022-09-16 11:45:45 +02:00
|
|
|
self::assertEquals($value, $object->$get());
|
2014-04-11 21:16:07 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|