Footnote fix

This commit is contained in:
Ivan Lanin 2014-03-14 04:26:50 +07:00
parent b11cd40bba
commit cd3f74e572
2 changed files with 41 additions and 0 deletions

View File

@ -138,6 +138,13 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write
'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml'
);
// Footnotes
$this->_writeOverrideContentType(
$objWriter,
'/word/footnotes.xml',
'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml'
);
for ($i = 1; $i <= $_cHdrs; $i++) {
$this->_writeOverrideContentType(
$objWriter,

View File

@ -0,0 +1,34 @@
<?php
namespace PHPWord\Tests\Writer\Word2007;
use PHPWord;
use PHPWord\Tests\TestHelperDOCX;
/**
* Class PHPWord_Writer_Word2007_FootnotesTest
* @package PHPWord\Tests
* @runTestsInSeparateProcesses
*/
class FootnotesTest extends \PHPUnit_Framework_TestCase
{
/**
* Executed before each method of the class
*/
public function tearDown()
{
TestHelperDOCX::clear();
}
public function testWriteFootnotes()
{
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
$section->addText('Text');
$footnote = $section->createFootnote();
$footnote->addText('Footnote');
$footnote->addLink('http://google.com');
$doc = TestHelperDOCX::getDocument($PHPWord);
$this->assertEquals(1, 1);
}
}