Fix Travis test errors

This commit is contained in:
Ivan Lanin 2014-05-10 21:56:06 +07:00
parent c82f0ac1fc
commit feff87e769
3 changed files with 18 additions and 16 deletions

View File

@ -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)

View File

@ -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':

View File

@ -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);