Make one level Element folder structure (move Cell and Row up one level)
This commit is contained in:
parent
f0ee25f343
commit
06ba9e7093
|
|
@ -7,7 +7,7 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
*/
|
||||
|
||||
namespace PhpOffice\PhpWord\Element\Table;
|
||||
namespace PhpOffice\PhpWord\Element;
|
||||
|
||||
use PhpOffice\PhpWord\Container\Container;
|
||||
use PhpOffice\PhpWord\Style\Cell as CellStyle;
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
*/
|
||||
|
||||
namespace PhpOffice\PhpWord\Element\Table;
|
||||
namespace PhpOffice\PhpWord\Element;
|
||||
|
||||
/**
|
||||
* Table row element
|
||||
|
|
@ -83,7 +83,7 @@ class Row
|
|||
*
|
||||
* @param int $width
|
||||
* @param mixed $style
|
||||
* @return \PhpOffice\PhpWord\Element\Table\Cell
|
||||
* @return \PhpOffice\PhpWord\Element\Cell
|
||||
*/
|
||||
public function addCell($width = null, $style = null)
|
||||
{
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Element;
|
||||
|
||||
use PhpOffice\PhpWord\Element\Table\Row;
|
||||
use PhpOffice\PhpWord\Element\Row;
|
||||
|
||||
/**
|
||||
* Table element
|
||||
|
|
@ -98,7 +98,7 @@ class Table
|
|||
*
|
||||
* @param int $width
|
||||
* @param mixed $style
|
||||
* @return \PhpOffice\PhpWord\Element\Table\Cell
|
||||
* @return \PhpOffice\PhpWord\Element\Cell
|
||||
*/
|
||||
public function addCell($width = null, $style = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
*/
|
||||
|
||||
namespace PhpOffice\PhpWord\Tests\Element\Table;
|
||||
namespace PhpOffice\PhpWord\Tests\Element;
|
||||
|
||||
use PhpOffice\PhpWord\Element\Table\Cell;
|
||||
use PhpOffice\PhpWord\Element\Cell;
|
||||
|
||||
/**
|
||||
* Test class for PhpOffice\PhpWord\Element\Table\Cell
|
||||
* Test class for PhpOffice\PhpWord\Element\Cell
|
||||
*
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
|
|
@ -26,7 +26,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
$iVal = rand(1, 1000);
|
||||
$oCell = new Cell('section', $iVal);
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $oCell);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $oCell);
|
||||
$this->assertEquals($oCell->getWidth(), null);
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testAddImageSection()
|
||||
{
|
||||
$src = __DIR__ . "/../../_files/images/earth.jpg";
|
||||
$src = __DIR__ . "/../_files/images/earth.jpg";
|
||||
$oCell = new Cell('section', 1);
|
||||
$element1 = $oCell->addImage($src);
|
||||
$element2 = $oCell->addMemoryImage($src); // @deprecated
|
||||
|
|
@ -146,7 +146,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testAddImageHeader()
|
||||
{
|
||||
$src = __DIR__ . "/../../_files/images/earth.jpg";
|
||||
$src = __DIR__ . "/../_files/images/earth.jpg";
|
||||
$oCell = new Cell('header', 1);
|
||||
$element = $oCell->addImage($src);
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testAddImageFooter()
|
||||
{
|
||||
$src = __DIR__ . "/../../_files/images/earth.jpg";
|
||||
$src = __DIR__ . "/../_files/images/earth.jpg";
|
||||
$oCell = new Cell('footer', 1);
|
||||
$element = $oCell->addImage($src);
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testAddObjectXLS()
|
||||
{
|
||||
$src = __DIR__ . "/../../_files/documents/sheet.xls";
|
||||
$src = __DIR__ . "/../_files/documents/sheet.xls";
|
||||
$oCell = new Cell('section', 1);
|
||||
$element = $oCell->addObject($src);
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testAddObjectException()
|
||||
{
|
||||
$src = __DIR__ . "/_files/xsl/passthrough.xsl";
|
||||
$src = __DIR__ . "/../_files/xsl/passthrough.xsl";
|
||||
$oCell = new Cell('section', 1);
|
||||
$element = $oCell->addObject($src);
|
||||
}
|
||||
|
|
@ -7,14 +7,14 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
*/
|
||||
|
||||
namespace PhpOffice\PhpWord\Tests\Element\Table;
|
||||
namespace PhpOffice\PhpWord\Tests\Element;
|
||||
|
||||
use PhpOffice\PhpWord\Element\Table\Row;
|
||||
use PhpOffice\PhpWord\Element\Row;
|
||||
|
||||
/**
|
||||
* Test class for PhpOffice\PhpWord\Element\Table\Row
|
||||
* Test class for PhpOffice\PhpWord\Element\Row
|
||||
*
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Element\Table\Row
|
||||
* @coversDefaultClass \PhpOffice\PhpWord\Element\Row
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class RowTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
@ -27,7 +27,7 @@ class RowTest extends \PHPUnit_Framework_TestCase
|
|||
$iVal = rand(1, 1000);
|
||||
$oRow = new Row('section', $iVal);
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Row', $oRow);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $oRow);
|
||||
$this->assertEquals($oRow->getHeight(), null);
|
||||
$this->assertInternalType('array', $oRow->getCells());
|
||||
$this->assertCount(0, $oRow->getCells());
|
||||
|
|
@ -60,7 +60,7 @@ class RowTest extends \PHPUnit_Framework_TestCase
|
|||
$oRow = new Row('section', 1);
|
||||
$element = $oRow->addCell();
|
||||
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
|
||||
$this->assertCount(1, $oRow->getCells());
|
||||
}
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$oTable = new Table('section', 1);
|
||||
$element = $oTable->addRow();
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Row', $element);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $element);
|
||||
$this->assertCount(1, $oTable->getRows());
|
||||
}
|
||||
|
||||
|
|
@ -87,6 +87,6 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
|||
$oTable = new Table('section', 1);
|
||||
$oTable->addRow();
|
||||
$element = $oTable->addCell();
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element);
|
||||
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue