Fix Travis test errors
This commit is contained in:
parent
c82f0ac1fc
commit
feff87e769
|
|
@ -49,8 +49,6 @@ class Table extends AbstractElement
|
||||||
/**
|
/**
|
||||||
* Create a new table
|
* Create a new table
|
||||||
*
|
*
|
||||||
* @param string $docPart
|
|
||||||
* @param integer $docPartId
|
|
||||||
* @param mixed $style
|
* @param mixed $style
|
||||||
*/
|
*/
|
||||||
public function __construct($style = null)
|
public function __construct($style = null)
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ class Html
|
||||||
/**
|
/**
|
||||||
* parse Inline style of a node
|
* parse Inline style of a node
|
||||||
*
|
*
|
||||||
* @param $node node to check on attributes and to compile a style array
|
* @param \DOMNode $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 array $style is supplied, the inline style attributes are added to the already existing style
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected static function parseInlineStyle($node, $style = array())
|
protected static function parseInlineStyle($node, $style = array())
|
||||||
|
|
@ -99,14 +99,18 @@ class Html
|
||||||
/**
|
/**
|
||||||
* parse a node and add a corresponding element to the object
|
* parse a node and add a corresponding element to the object
|
||||||
*
|
*
|
||||||
* @param $node node to parse
|
* @param \DOMNode $node node to parse
|
||||||
* @param $object object to add an element corresponding with the node
|
* @param \PhpOffice\PhpWord\Element\AbstractElement $object object to add an element corresponding with the node
|
||||||
* @param $styles array with all styles
|
* @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
|
* @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;
|
$newobject = null;
|
||||||
switch ($node->nodeName) {
|
switch ($node->nodeName) {
|
||||||
case 'p':
|
case 'p':
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1);
|
$oTable = new Table();
|
||||||
|
|
||||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $oTable);
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table', $oTable);
|
||||||
$this->assertEquals($oTable->getStyle(), null);
|
$this->assertEquals($oTable->getStyle(), null);
|
||||||
|
|
@ -46,7 +46,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testStyleText()
|
public function testStyleText()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1, 'tableStyle');
|
$oTable = new Table('tableStyle');
|
||||||
|
|
||||||
$this->assertEquals($oTable->getStyle(), 'tableStyle');
|
$this->assertEquals($oTable->getStyle(), 'tableStyle');
|
||||||
}
|
}
|
||||||
|
|
@ -56,7 +56,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testStyleArray()
|
public function testStyleArray()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1, array(
|
$oTable = new Table(array(
|
||||||
'borderSize' => 6,
|
'borderSize' => 6,
|
||||||
'borderColor' => '006699',
|
'borderColor' => '006699',
|
||||||
'cellMargin' => 80
|
'cellMargin' => 80
|
||||||
|
|
@ -70,7 +70,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testWidth()
|
public function testWidth()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1);
|
$oTable = new Table();
|
||||||
$iVal = rand(1, 1000);
|
$iVal = rand(1, 1000);
|
||||||
$oTable->setWidth($iVal);
|
$oTable->setWidth($iVal);
|
||||||
$this->assertEquals($oTable->getWidth(), $iVal);
|
$this->assertEquals($oTable->getWidth(), $iVal);
|
||||||
|
|
@ -81,7 +81,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testRow()
|
public function testRow()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1);
|
$oTable = new Table();
|
||||||
$element = $oTable->addRow();
|
$element = $oTable->addRow();
|
||||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $element);
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $element);
|
||||||
$this->assertCount(1, $oTable->getRows());
|
$this->assertCount(1, $oTable->getRows());
|
||||||
|
|
@ -92,7 +92,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testCell()
|
public function testCell()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1);
|
$oTable = new Table();
|
||||||
$oTable->addRow();
|
$oTable->addRow();
|
||||||
$element = $oTable->addCell();
|
$element = $oTable->addCell();
|
||||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
|
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
|
||||||
|
|
@ -103,7 +103,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testCountColumns()
|
public function testCountColumns()
|
||||||
{
|
{
|
||||||
$oTable = new Table('section', 1);
|
$oTable = new Table();
|
||||||
$oTable->addRow();
|
$oTable->addRow();
|
||||||
$element = $oTable->addCell();
|
$element = $oTable->addCell();
|
||||||
$this->assertEquals($oTable->countColumns(), 1);
|
$this->assertEquals($oTable->countColumns(), 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue