From feff87e769057ec0b1f33c620d765920ec48746a Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Sat, 10 May 2014 21:56:06 +0700 Subject: [PATCH] Fix Travis test errors --- src/PhpWord/Element/Table.php | 2 -- src/PhpWord/Shared/Html.php | 18 +++++++++++------- tests/PhpWord/Tests/Element/TableTest.php | 14 +++++++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/PhpWord/Element/Table.php b/src/PhpWord/Element/Table.php index 87d44e41..e87c591f 100644 --- a/src/PhpWord/Element/Table.php +++ b/src/PhpWord/Element/Table.php @@ -49,8 +49,6 @@ class Table extends AbstractElement /** * Create a new table * - * @param string $docPart - * @param integer $docPartId * @param mixed $style */ public function __construct($style = null) diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index bcefb985..b09afddb 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -51,8 +51,8 @@ class Html /** * parse Inline style of a node * - * @param $node node to check on attributes and to compile a style array - * @param $style is supplied, the inline style attributes are added to the already existing style + * @param \DOMNode $node Node to check on attributes and to compile a style array + * @param array $style is supplied, the inline style attributes are added to the already existing style * */ protected static function parseInlineStyle($node, $style = array()) @@ -99,14 +99,18 @@ class Html /** * parse a node and add a corresponding element to the object * - * @param $node node to parse - * @param $object object to add an element corresponding with the node - * @param $styles array with all styles + * @param \DOMNode $node node to parse + * @param \PhpOffice\PhpWord\Element\AbstractElement $object object to add an element corresponding with the node + * @param array $styles Array with all styles * @param $data array to transport data to a next level in the DOM tree, for example level of listitems * */ - protected static function parseNode($node, $object, $styles = array('fontStyle' => array(), 'paragraphStyle' => array(), 'listStyle' => array()), $data = array()) - { + protected static function parseNode( + $node, + $object, + $styles = array('fontStyle' => array(), 'paragraphStyle' => array(), 'listStyle' => array()), + $data = array() + ) { $newobject = null; switch ($node->nodeName) { case 'p': diff --git a/tests/PhpWord/Tests/Element/TableTest.php b/tests/PhpWord/Tests/Element/TableTest.php index 1c87c2cf..0977639f 100644 --- a/tests/PhpWord/Tests/Element/TableTest.php +++ b/tests/PhpWord/Tests/Element/TableTest.php @@ -32,7 +32,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testConstruct() { - $oTable = new Table('section', 1); + $oTable = new Table(); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $oTable); $this->assertEquals($oTable->getStyle(), null); @@ -46,7 +46,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testStyleText() { - $oTable = new Table('section', 1, 'tableStyle'); + $oTable = new Table('tableStyle'); $this->assertEquals($oTable->getStyle(), 'tableStyle'); } @@ -56,7 +56,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testStyleArray() { - $oTable = new Table('section', 1, array( + $oTable = new Table(array( 'borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80 @@ -70,7 +70,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testWidth() { - $oTable = new Table('section', 1); + $oTable = new Table(); $iVal = rand(1, 1000); $oTable->setWidth($iVal); $this->assertEquals($oTable->getWidth(), $iVal); @@ -81,7 +81,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testRow() { - $oTable = new Table('section', 1); + $oTable = new Table(); $element = $oTable->addRow(); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $element); $this->assertCount(1, $oTable->getRows()); @@ -92,7 +92,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testCell() { - $oTable = new Table('section', 1); + $oTable = new Table(); $oTable->addRow(); $element = $oTable->addCell(); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element); @@ -103,7 +103,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ public function testCountColumns() { - $oTable = new Table('section', 1); + $oTable = new Table(); $oTable->addRow(); $element = $oTable->addCell(); $this->assertEquals($oTable->countColumns(), 1);