PHPWord/tests/PhpWordTests/Style/NumberingLevelTest.php

60 lines
1.7 KiB
PHP
Raw Normal View History

<?php
/**
* 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.
*
* @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
*/
2022-09-16 14:09:17 +02:00
namespace PhpOffice\PhpWordTests\Style;
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;
/**
2022-09-16 11:45:45 +02:00
* Test class for PhpOffice\PhpWord\Style\NumberingLevel.
*
* @runTestsInSeparateProcesses
*/
class NumberingLevelTest extends \PHPUnit\Framework\TestCase
{
/**
2022-09-16 11:45:45 +02:00
* Test setting style with normal value.
*/
2022-09-16 11:45:45 +02:00
public function testSetGetNormal(): void
{
$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',
];
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());
}
}
}