49 lines
1.3 KiB
PHP
Raw Normal View History

2014-03-14 04:26:50 +07:00
<?php
2014-03-27 23:55:06 +07:00
/**
* PHPWord
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
namespace PhpOffice\PhpWord\Tests\Writer\Word2007;
2014-03-14 04:26:50 +07:00
use PhpOffice\PhpWord\PhpWord;
2014-03-23 12:37:31 -04:00
use PhpOffice\PhpWord\Tests\TestHelperDOCX;
2014-03-14 04:26:50 +07:00
/**
2014-04-09 21:35:55 +07:00
* Test class for PhpOffice\PhpWord\Writer\Word2007\Notes
2014-03-27 23:55:06 +07:00
*
2014-03-14 04:26:50 +07:00
* @runTestsInSeparateProcesses
*/
2014-04-09 21:35:55 +07:00
class NotesTest extends \PHPUnit_Framework_TestCase
2014-03-14 04:26:50 +07:00
{
/**
* Executed before each method of the class
*/
public function tearDown()
{
TestHelperDOCX::clear();
}
2014-03-30 14:15:23 +07:00
/**
* Write footnotes
*/
2014-03-14 04:26:50 +07:00
public function testWriteFootnotes()
{
$phpWord = new PhpWord();
2014-03-30 11:09:14 +07:00
$phpWord->addParagraphStyle('pStyle', array('align' => 'left'));
$section = $phpWord->addSection();
2014-03-14 04:26:50 +07:00
$section->addText('Text');
$footnote1 = $section->addFootnote('pStyle');
2014-03-30 11:09:14 +07:00
$footnote1->addText('Footnote');
$footnote1->addTextBreak();
$footnote1->addLink('http://google.com');
$footnote2 = $section->addFootnote(array('align' => 'left'));
2014-03-30 11:09:14 +07:00
$footnote2->addText('Footnote');
$doc = TestHelperDOCX::getDocument($phpWord);
2014-03-14 04:26:50 +07:00
2014-03-14 04:39:41 +07:00
$this->assertTrue($doc->elementExists("/w:document/w:body/w:p/w:r/w:footnoteReference"));
2014-03-14 04:26:50 +07:00
}
}