2014-04-17 16:19:23 +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-17 16:19:23 +07:00
|
|
|
*
|
|
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
2016-07-31 12:35:06 +04:00
|
|
|
* @copyright 2010-2016 PHPWord contributors
|
2014-05-04 21:03:28 +04:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
2014-04-17 16:19:23 +07:00
|
|
|
*/
|
2015-11-15 13:33:05 +04:00
|
|
|
namespace PhpOffice\PhpWord\Writer\Word2007\Part;
|
2014-04-17 16:19:23 +07:00
|
|
|
|
|
|
|
|
use PhpOffice\PhpWord\PhpWord;
|
2015-10-10 19:22:19 +04:00
|
|
|
use PhpOffice\PhpWord\SimpleType\Jc;
|
2015-11-15 13:33:05 +04:00
|
|
|
use PhpOffice\PhpWord\TestHelperDOCX;
|
2014-04-17 16:19:23 +07:00
|
|
|
|
|
|
|
|
/**
|
2014-04-30 08:54:38 +07:00
|
|
|
* Test class for PhpOffice\PhpWord\Writer\Word2007\Part\Numbering
|
2014-04-17 16:19:23 +07:00
|
|
|
*
|
2014-04-30 08:54:38 +07:00
|
|
|
* @coversDefaultClass \PhpOffice\PhpWord\Writer\Word2007\Part\Numbering
|
2014-04-17 16:19:23 +07:00
|
|
|
* @runTestsInSeparateProcesses
|
|
|
|
|
* @since 0.10.0
|
|
|
|
|
*/
|
|
|
|
|
class NumberingTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Executed before each method of the class
|
|
|
|
|
*/
|
|
|
|
|
public function tearDown()
|
|
|
|
|
{
|
|
|
|
|
TestHelperDOCX::clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Write footnotes
|
|
|
|
|
*/
|
|
|
|
|
public function testWriteNumbering()
|
|
|
|
|
{
|
|
|
|
|
$xmlFile = 'word/numbering.xml';
|
|
|
|
|
|
|
|
|
|
$phpWord = new PhpWord();
|
|
|
|
|
$phpWord->addNumberingStyle(
|
|
|
|
|
'numStyle',
|
|
|
|
|
array(
|
2015-02-06 22:28:31 +04:00
|
|
|
'type' => 'multilevel',
|
2014-04-17 16:19:23 +07:00
|
|
|
'levels' => array(
|
|
|
|
|
array(
|
2015-10-10 19:06:23 +04:00
|
|
|
'start' => 1,
|
|
|
|
|
'format' => 'decimal',
|
|
|
|
|
'restart' => 1,
|
|
|
|
|
'suffix' => 'space',
|
|
|
|
|
'text' => '%1.',
|
2015-10-10 19:22:19 +04:00
|
|
|
'alignment' => Jc::START,
|
2015-10-10 19:06:23 +04:00
|
|
|
'left' => 360,
|
|
|
|
|
'hanging' => 360,
|
|
|
|
|
'tabPos' => 360,
|
|
|
|
|
'font' => 'Arial',
|
|
|
|
|
'hint' => 'default',
|
2014-04-17 16:19:23 +07:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$doc = TestHelperDOCX::getDocument($phpWord, 'Word2007');
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($doc->elementExists('/w:numbering/w:abstractNum', $xmlFile));
|
|
|
|
|
}
|
|
|
|
|
}
|