Fix unit test error

This commit is contained in:
Ivan Lanin 2014-04-09 20:44:32 +07:00
parent 0ccea9620c
commit 38418677f8
3 changed files with 6 additions and 5 deletions

View File

@ -403,13 +403,14 @@ class Word2007 extends AbstractReader implements ReaderInterface
$parent->addTextBreak(null, $pStyle);
} else {
if ($runLinkCount > 1) {
$textContainer = &$parent->addTextRun($pStyle);
$textrun = $parent->addTextRun($pStyle);
$textParent = &$textrun;
} else {
$textContainer = &$parent;
$textParent = &$parent;
}
$nodes = $xmlReader->getElements('*', $domNode);
foreach ($nodes as $node) {
$this->readRun($xmlReader, $node, $textContainer, $docPart, $pStyle);
$this->readRun($xmlReader, $node, $textParent, $docPart, $pStyle);
}
}
}

View File

@ -24,7 +24,7 @@ class StyleTest extends \PHPUnit_Framework_TestCase
public function testStyles()
{
$paragraph = array('align' => 'center');
$font = array('italic' => true);
$font = array('italic' => true, '_bold' => true);
$table = array('bgColor' => 'CCCCCC');
$styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font',
'Link' => 'Font', 'Table' => 'Table',

View File

@ -28,7 +28,7 @@ class TOCTest extends \PHPUnit_Framework_TestCase
'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
'indent' => 200,
);
$object = new TOC(array('size' => 11), array('tabPos' => $expected['tabPos']));
$object = new TOC(array('_size' => 11), array('_tabPos' => $expected['tabPos']));
$tocStyle = $object->getStyleTOC();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle);