Code formatting for PSR1 & PSR2 - Part 2
This commit is contained in:
parent
4e3450e39f
commit
d2a231799d
@ -12,7 +12,6 @@ use PHPWord_Shared_Drawing;
|
||||
*/
|
||||
class DrawingTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test unit conversion functions with various numbers
|
||||
*/
|
||||
@ -65,5 +64,4 @@ class DrawingTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($value[1], $result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,13 +12,13 @@ use PHPWord_Shared_File;
|
||||
*/
|
||||
class FileTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test file_exists()
|
||||
*/
|
||||
public function testFile_exists()
|
||||
public function testFileExists()
|
||||
{
|
||||
$dir = join(DIRECTORY_SEPARATOR,
|
||||
$dir = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates')
|
||||
);
|
||||
chdir($dir);
|
||||
@ -30,12 +30,13 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testRealpath()
|
||||
{
|
||||
$dir = join(DIRECTORY_SEPARATOR,
|
||||
array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates'));
|
||||
$dir = join(
|
||||
DIRECTORY_SEPARATOR,
|
||||
array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates')
|
||||
);
|
||||
chdir($dir);
|
||||
$file = 'blank.docx';
|
||||
$expected = $dir . DIRECTORY_SEPARATOR . $file;
|
||||
$this->assertEquals($expected, PHPWord_Shared_File::realpath($file));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Shared_String;
|
||||
*/
|
||||
class StringTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test getIsMbstringEnabled() and getIsIconvEnabled()
|
||||
*/
|
||||
@ -41,5 +40,4 @@ class StringTest extends \PHPUnit_Framework_TestCase
|
||||
$returned = PHPWord_Shared_String::FormatNumber('1022.1234');
|
||||
$this->assertEquals($expected, $returned);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_Cell;
|
||||
*/
|
||||
class CellTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test setting style with normal value
|
||||
*/
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_Image;
|
||||
*/
|
||||
class ImageTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test setting style with normal value
|
||||
*/
|
||||
@ -67,5 +66,4 @@ class ImageTest extends \PHPUnit_Framework_TestCase
|
||||
$object = new PHPWord_Style_Image();
|
||||
$object->setWrappingStyle('foo');
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_ListItem;
|
||||
*/
|
||||
class ListItemTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test construct
|
||||
*/
|
||||
@ -47,5 +46,4 @@ class ListItemTest extends \PHPUnit_Framework_TestCase
|
||||
$object->setListType($value);
|
||||
$this->assertEquals($value, $object->getListType());
|
||||
}
|
||||
|
||||
}
|
||||
@ -133,5 +133,4 @@ class ParagraphTest extends \PHPUnit_Framework_TestCase
|
||||
$object->setLineHeight('12.5pt');
|
||||
$this->assertEquals(12.5, $object->getLineHeight());
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_Row;
|
||||
*/
|
||||
class RowTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test properties with normal value
|
||||
*/
|
||||
@ -39,5 +38,4 @@ class RowTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($expected, $object->$get());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_TOC;
|
||||
*/
|
||||
class TOCTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test properties with normal value
|
||||
*/
|
||||
@ -37,5 +36,4 @@ class TOCTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(null, $object->$get());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_TableFull;
|
||||
*/
|
||||
class TableFullTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test class construction
|
||||
*
|
||||
@ -132,5 +131,4 @@ class TableFullTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
$this->assertEquals($values, $object->getCellMargin());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use PHPWord_Style_Table;
|
||||
*/
|
||||
class TableTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test set style value
|
||||
*/
|
||||
@ -50,5 +49,4 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
$this->assertEquals($values, $object->getCellMargin());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,5 +42,4 @@ class TabsTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(1440, $element->getAttribute('w:pos'));
|
||||
$this->assertEquals('dot', $element->getAttribute('w:leader'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
TestHelperDOCX::clear();
|
||||
}
|
||||
|
||||
public function testWriteImage_Position()
|
||||
public function testWriteImagePosition()
|
||||
{
|
||||
$PHPWord = new PHPWord();
|
||||
$section = $PHPWord->createSection();
|
||||
@ -42,7 +42,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertRegExp('/position:absolute;/', $style);
|
||||
}
|
||||
|
||||
public function testWriteParagraphStyle_Align()
|
||||
public function testWriteParagraphStyleAlign()
|
||||
{
|
||||
$PHPWord = new PHPWord();
|
||||
$section = $PHPWord->createSection();
|
||||
@ -55,34 +55,10 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('right', $element->getAttribute('w:val'));
|
||||
}
|
||||
|
||||
public function testWriteCellStyle_CellGridSpan()
|
||||
{
|
||||
$PHPWord = new PHPWord();
|
||||
$section = $PHPWord->createSection();
|
||||
|
||||
$table = $section->addTable();
|
||||
|
||||
$table->addRow();
|
||||
$cell = $table->addCell(200);
|
||||
$cell->getStyle()->setGridSpan(5);
|
||||
|
||||
$table->addRow();
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
|
||||
$doc = TestHelperDOCX::getDocument($PHPWord);
|
||||
$element = $doc->getElement('/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:gridSpan');
|
||||
|
||||
$this->assertEquals(5, $element->getAttribute('w:val'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test write paragraph pagination
|
||||
*/
|
||||
public function testWriteParagraphStyle_Pagination()
|
||||
public function testWriteParagraphStylePagination()
|
||||
{
|
||||
// Create the doc
|
||||
$PHPWord = new PHPWord();
|
||||
@ -108,4 +84,28 @@ class BaseTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($expected, $element->getAttribute('w:val'));
|
||||
}
|
||||
}
|
||||
|
||||
public function testWriteCellStyleCellGridSpan()
|
||||
{
|
||||
$PHPWord = new PHPWord();
|
||||
$section = $PHPWord->createSection();
|
||||
|
||||
$table = $section->addTable();
|
||||
|
||||
$table->addRow();
|
||||
$cell = $table->addCell(200);
|
||||
$cell->getStyle()->setGridSpan(5);
|
||||
|
||||
$table->addRow();
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
$table->addCell(40);
|
||||
|
||||
$doc = TestHelperDOCX::getDocument($PHPWord);
|
||||
$element = $doc->getElement('/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:gridSpan');
|
||||
|
||||
$this->assertEquals(5, $element->getAttribute('w:val'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
|
||||
TestHelperDOCX::clear();
|
||||
}
|
||||
|
||||
public function testWriteEndSection_PageNumbering()
|
||||
public function testWriteEndSectionPageNumbering()
|
||||
{
|
||||
$PHPWord = new PHPWord();
|
||||
$section = $PHPWord->createSection();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user