Increase minimum mass for php_sim and some test fixes

This commit is contained in:
Ivan Lanin 2014-05-15 10:24:20 +07:00
parent 27fa3ba233
commit abbf60a3be
4 changed files with 18 additions and 36 deletions

View File

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

View File

@ -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);
}
}
/**

View File

@ -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,7 +56,7 @@ 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());
@ -68,17 +68,10 @@ class ListItemRunTest extends \PHPUnit_Framework_TestCase
*/
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

View File

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