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); $parent->addTextBreak(null, $pStyle);
} else { } else {
if ($runLinkCount > 1) { if ($runLinkCount > 1) {
$textContainer = &$parent->addTextRun($pStyle); $textrun = $parent->addTextRun($pStyle);
$textParent = &$textrun;
} else { } else {
$textContainer = &$parent; $textParent = &$parent;
} }
$nodes = $xmlReader->getElements('*', $domNode); $nodes = $xmlReader->getElements('*', $domNode);
foreach ($nodes as $node) { 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() public function testStyles()
{ {
$paragraph = array('align' => 'center'); $paragraph = array('align' => 'center');
$font = array('italic' => true); $font = array('italic' => true, '_bold' => true);
$table = array('bgColor' => 'CCCCCC'); $table = array('bgColor' => 'CCCCCC');
$styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font', $styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font',
'Link' => 'Font', 'Table' => 'Table', 'Link' => 'Font', 'Table' => 'Table',

View File

@ -28,7 +28,7 @@ class TOCTest extends \PHPUnit_Framework_TestCase
'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT, 'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
'indent' => 200, '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(); $tocStyle = $object->getStyleTOC();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle); $this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle);