Skip to content

Commit 3841867

Browse files
committed
Fix unit test error
1 parent 0ccea96 commit 3841867

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/PhpWord/Reader/Word2007.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,14 @@ private function readParagraph(XMLReader $xmlReader, \DOMNode $domNode, &$parent
403403
$parent->addTextBreak(null, $pStyle);
404404
} else {
405405
if ($runLinkCount > 1) {
406-
$textContainer = &$parent->addTextRun($pStyle);
406+
$textrun = $parent->addTextRun($pStyle);
407+
$textParent = &$textrun;
407408
} else {
408-
$textContainer = &$parent;
409+
$textParent = &$parent;
409410
}
410411
$nodes = $xmlReader->getElements('*', $domNode);
411412
foreach ($nodes as $node) {
412-
$this->readRun($xmlReader, $node, $textContainer, $docPart, $pStyle);
413+
$this->readRun($xmlReader, $node, $textParent, $docPart, $pStyle);
413414
}
414415
}
415416
}

tests/PhpWord/Tests/StyleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class StyleTest extends \PHPUnit_Framework_TestCase
2424
public function testStyles()
2525
{
2626
$paragraph = array('align' => 'center');
27-
$font = array('italic' => true);
27+
$font = array('italic' => true, '_bold' => true);
2828
$table = array('bgColor' => 'CCCCCC');
2929
$styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font',
3030
'Link' => 'Font', 'Table' => 'Table',

tests/PhpWord/Tests/TOCTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testConstructWithStyleArray()
2828
'tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT,
2929
'indent' => 200,
3030
);
31-
$object = new TOC(array('size' => 11), array('tabPos' => $expected['tabPos']));
31+
$object = new TOC(array('_size' => 11), array('_tabPos' => $expected['tabPos']));
3232
$tocStyle = $object->getStyleTOC();
3333

3434
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\TOC', $tocStyle);

0 commit comments

Comments
 (0)