Increase minimum mass for php_sim and some test fixes
This commit is contained in:
parent
27fa3ba233
commit
abbf60a3be
|
|
@ -18,7 +18,7 @@ tools:
|
|||
timeout: 900
|
||||
php_sim:
|
||||
enabled: true
|
||||
min_mass: 30
|
||||
min_mass: 40
|
||||
php_pdepend: true
|
||||
php_analyzer: true
|
||||
sensiolabs_security_checker: true
|
||||
|
|
|
|||
|
|
@ -123,23 +123,24 @@ class Table extends Border
|
|||
public function __construct($tableStyle = null, $firstRowStyle = null)
|
||||
{
|
||||
$this->alignment = new Alignment();
|
||||
if ($tableStyle !== null && is_array($tableStyle)) {
|
||||
$this->setStyleByArray($tableStyle);
|
||||
}
|
||||
|
||||
if ($firstRowStyle !== null && is_array($firstRowStyle)) {
|
||||
$this->firstRow = clone $this;
|
||||
unset($this->firstRow->firstRow);
|
||||
unset($this->firstRow->cellMarginBottom);
|
||||
unset($this->firstRow->borderInsideHSize);
|
||||
unset($this->firstRow->borderInsideHColor);
|
||||
unset($this->firstRow->borderInsideVSize);
|
||||
unset($this->firstRow->borderInsideVColor);
|
||||
unset($this->firstRow->cellMarginTop);
|
||||
unset($this->firstRow->cellMarginLeft);
|
||||
unset($this->firstRow->cellMarginRight);
|
||||
unset($this->firstRow->borderInsideVColor);
|
||||
unset($this->firstRow->borderInsideVSize);
|
||||
unset($this->firstRow->borderInsideHColor);
|
||||
unset($this->firstRow->borderInsideHSize);
|
||||
unset($this->firstRow->cellMarginBottom);
|
||||
$this->firstRow->setStyleByArray($firstRowStyle);
|
||||
}
|
||||
|
||||
if ($tableStyle !== null && is_array($tableStyle)) {
|
||||
$this->setStyleByArray($tableStyle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ListItemRunTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testConstructString()
|
||||
{
|
||||
$oListItemRun = new ListItemRun(0, null, null, 'pStyle');
|
||||
$oListItemRun = new ListItemRun(0, null, 'pStyle');
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItemRun', $oListItemRun);
|
||||
$this->assertCount(0, $oListItemRun->getElements());
|
||||
|
|
@ -56,29 +56,22 @@ class ListItemRunTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testConstructArray()
|
||||
{
|
||||
$oListItemRun = new ListItemRun(0, null, null, array('spacing' => 100));
|
||||
$oListItemRun = new ListItemRun(0, null, array('spacing' => 100));
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItemRun', $oListItemRun);
|
||||
$this->assertCount(0, $oListItemRun->getElements());
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oListItemRun->getParagraphStyle());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get style
|
||||
*/
|
||||
public function testStyle()
|
||||
{
|
||||
$oListItemRun = new ListItemRun(
|
||||
1,
|
||||
null,
|
||||
array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER)
|
||||
);
|
||||
|
||||
$oListItemRun = new ListItemRun(1, array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER));
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\ListItem', $oListItemRun->getStyle());
|
||||
$this->assertEquals(
|
||||
$oListItemRun->getStyle()->getListType(),
|
||||
\PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER
|
||||
);
|
||||
$this->assertEquals($oListItemRun->getStyle()->getListType(), \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER);
|
||||
}
|
||||
/**
|
||||
* getDepth
|
||||
|
|
@ -87,10 +80,10 @@ class ListItemRunTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$iVal = rand(1, 1000);
|
||||
$oListItemRun = new ListItemRun($iVal);
|
||||
|
||||
|
||||
$this->assertEquals($oListItemRun->getDepth(), $iVal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add text
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -47,16 +47,4 @@ class TitleTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertEquals($oTitle->getStyle(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bookmark Id
|
||||
*/
|
||||
public function testBookmarkID()
|
||||
{
|
||||
$oTitle = new Title('text');
|
||||
|
||||
$iVal = rand(1, 1000);
|
||||
$oTitle->setBookmarkId($iVal);
|
||||
$this->assertEquals($oTitle->getRelationId(), $iVal);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue