add test, fix warnings
This commit is contained in:
parent
670d46e543
commit
e07195c512
@ -18,10 +18,10 @@
|
||||
namespace PhpOffice\PhpWord\Shared;
|
||||
|
||||
use PhpOffice\PhpWord\Element\AbstractContainer;
|
||||
use PhpOffice\PhpWord\Element\Cell;
|
||||
use PhpOffice\PhpWord\Element\Row;
|
||||
use PhpOffice\PhpWord\Element\Table;
|
||||
use PhpOffice\PhpWord\SimpleType\Jc;
|
||||
use PhpOffice\PhpWord\Element\Cell;
|
||||
|
||||
/**
|
||||
* Common Html functions
|
||||
|
||||
@ -20,8 +20,8 @@ namespace PhpOffice\PhpWord\Style;
|
||||
use PhpOffice\Common\Text;
|
||||
use PhpOffice\PhpWord\Exception\InvalidStyleException;
|
||||
use PhpOffice\PhpWord\SimpleType\Jc;
|
||||
use PhpOffice\PhpWord\SimpleType\TextAlignment;
|
||||
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
|
||||
use PhpOffice\PhpWord\SimpleType\TextAlignment;
|
||||
|
||||
/**
|
||||
* Paragraph style
|
||||
|
||||
@ -143,7 +143,7 @@ class Spacing extends AbstractStyle
|
||||
{
|
||||
return $this->lineRule;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set line rule
|
||||
*
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
namespace PhpOffice\PhpWord\Style;
|
||||
|
||||
use PhpOffice\PhpWord\PhpWord;
|
||||
use PhpOffice\PhpWord\TestHelperDOCX;
|
||||
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
|
||||
use PhpOffice\PhpWord\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
* Test class for PhpOffice\PhpWord\Style\Paragraph
|
||||
|
||||
@ -22,7 +22,9 @@ use PhpOffice\PhpWord\Metadata\DocInfo;
|
||||
use PhpOffice\PhpWord\PhpWord;
|
||||
use PhpOffice\PhpWord\SimpleType\Jc;
|
||||
use PhpOffice\PhpWord\SimpleType\NumberFormat;
|
||||
use PhpOffice\PhpWord\Style\Cell;
|
||||
use PhpOffice\PhpWord\Style\Font;
|
||||
use PhpOffice\PhpWord\Style\Paragraph;
|
||||
use PhpOffice\PhpWord\TestHelperDOCX;
|
||||
|
||||
/**
|
||||
@ -532,6 +534,25 @@ class DocumentTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertTrue($doc->elementExists("{$parent}/w:smallCaps"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that if no color is set on a cell a border gets writen with the default color
|
||||
*/
|
||||
public function testWriteDefaultColor()
|
||||
{
|
||||
$phpWord = new PhpWord();
|
||||
$section = $phpWord->addSection();
|
||||
|
||||
$cStyles['borderTopSize'] = 120;
|
||||
|
||||
$table = $section->addTable();
|
||||
$table->addRow();
|
||||
$cell = $table->addCell(null, $cStyles);
|
||||
$cell->addText('Test');
|
||||
|
||||
$doc = TestHelperDOCX::getDocument($phpWord);
|
||||
$this->assertEquals(Cell::DEFAULT_BORDER_COLOR, $doc->getElementAttribute('/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top', 'w:color'));
|
||||
}
|
||||
|
||||
/**
|
||||
* covers ::_writeTableStyle
|
||||
*/
|
||||
@ -565,7 +586,7 @@ class DocumentTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$section = $phpWord->addSection();
|
||||
$table = $section->addTable($tStyles);
|
||||
$table->setWidth = 100;
|
||||
$table->setWidth(100);
|
||||
$table->addRow($rHeight, $rStyles);
|
||||
$cell = $table->addCell($cWidth, $cStyles);
|
||||
$cell->addText('Test');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user