From 38418677f86034011532e2d0413081532e52e5f5 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Wed, 9 Apr 2014 20:44:32 +0700 Subject: [PATCH] Fix unit test error --- src/PhpWord/Reader/Word2007.php | 7 ++++--- tests/PhpWord/Tests/StyleTest.php | 2 +- tests/PhpWord/Tests/TOCTest.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PhpWord/Reader/Word2007.php b/src/PhpWord/Reader/Word2007.php index 422258f2..f2687924 100644 --- a/src/PhpWord/Reader/Word2007.php +++ b/src/PhpWord/Reader/Word2007.php @@ -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); } } } diff --git a/tests/PhpWord/Tests/StyleTest.php b/tests/PhpWord/Tests/StyleTest.php index bf28fa88..4ace72b6 100644 --- a/tests/PhpWord/Tests/StyleTest.php +++ b/tests/PhpWord/Tests/StyleTest.php @@ -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', diff --git a/tests/PhpWord/Tests/TOCTest.php b/tests/PhpWord/Tests/TOCTest.php index 7092795a..5417bb44 100644 --- a/tests/PhpWord/Tests/TOCTest.php +++ b/tests/PhpWord/Tests/TOCTest.php @@ -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);