Make one level Element folder structure (move Cell and Row up one level)

This commit is contained in:
Ivan Lanin 2014-04-02 11:11:59 +07:00
parent f0ee25f343
commit 06ba9e7093
6 changed files with 22 additions and 22 deletions

View File

@ -7,7 +7,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @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\Container\Container;
use PhpOffice\PhpWord\Style\Cell as CellStyle; use PhpOffice\PhpWord\Style\Cell as CellStyle;

View File

@ -7,7 +7,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @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 * Table row element
@ -83,7 +83,7 @@ class Row
* *
* @param int $width * @param int $width
* @param mixed $style * @param mixed $style
* @return \PhpOffice\PhpWord\Element\Table\Cell * @return \PhpOffice\PhpWord\Element\Cell
*/ */
public function addCell($width = null, $style = null) public function addCell($width = null, $style = null)
{ {

View File

@ -9,7 +9,7 @@
namespace PhpOffice\PhpWord\Element; namespace PhpOffice\PhpWord\Element;
use PhpOffice\PhpWord\Element\Table\Row; use PhpOffice\PhpWord\Element\Row;
/** /**
* Table element * Table element
@ -98,7 +98,7 @@ class Table
* *
* @param int $width * @param int $width
* @param mixed $style * @param mixed $style
* @return \PhpOffice\PhpWord\Element\Table\Cell * @return \PhpOffice\PhpWord\Element\Cell
*/ */
public function addCell($width = null, $style = null) public function addCell($width = null, $style = null)
{ {

View File

@ -7,12 +7,12 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @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 * @runTestsInSeparateProcesses
*/ */
@ -26,7 +26,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
$iVal = rand(1, 1000); $iVal = rand(1, 1000);
$oCell = new Cell('section', $iVal); $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); $this->assertEquals($oCell->getWidth(), null);
} }
@ -132,7 +132,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddImageSection() public function testAddImageSection()
{ {
$src = __DIR__ . "/../../_files/images/earth.jpg"; $src = __DIR__ . "/../_files/images/earth.jpg";
$oCell = new Cell('section', 1); $oCell = new Cell('section', 1);
$element1 = $oCell->addImage($src); $element1 = $oCell->addImage($src);
$element2 = $oCell->addMemoryImage($src); // @deprecated $element2 = $oCell->addMemoryImage($src); // @deprecated
@ -146,7 +146,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddImageHeader() public function testAddImageHeader()
{ {
$src = __DIR__ . "/../../_files/images/earth.jpg"; $src = __DIR__ . "/../_files/images/earth.jpg";
$oCell = new Cell('header', 1); $oCell = new Cell('header', 1);
$element = $oCell->addImage($src); $element = $oCell->addImage($src);
@ -159,7 +159,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddImageFooter() public function testAddImageFooter()
{ {
$src = __DIR__ . "/../../_files/images/earth.jpg"; $src = __DIR__ . "/../_files/images/earth.jpg";
$oCell = new Cell('footer', 1); $oCell = new Cell('footer', 1);
$element = $oCell->addImage($src); $element = $oCell->addImage($src);
@ -214,7 +214,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddObjectXLS() public function testAddObjectXLS()
{ {
$src = __DIR__ . "/../../_files/documents/sheet.xls"; $src = __DIR__ . "/../_files/documents/sheet.xls";
$oCell = new Cell('section', 1); $oCell = new Cell('section', 1);
$element = $oCell->addObject($src); $element = $oCell->addObject($src);
@ -229,7 +229,7 @@ class CellTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddObjectException() public function testAddObjectException()
{ {
$src = __DIR__ . "/_files/xsl/passthrough.xsl"; $src = __DIR__ . "/../_files/xsl/passthrough.xsl";
$oCell = new Cell('section', 1); $oCell = new Cell('section', 1);
$element = $oCell->addObject($src); $element = $oCell->addObject($src);
} }

View File

@ -7,14 +7,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @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 * @runTestsInSeparateProcesses
*/ */
class RowTest extends \PHPUnit_Framework_TestCase class RowTest extends \PHPUnit_Framework_TestCase
@ -27,7 +27,7 @@ class RowTest extends \PHPUnit_Framework_TestCase
$iVal = rand(1, 1000); $iVal = rand(1, 1000);
$oRow = new Row('section', $iVal); $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->assertEquals($oRow->getHeight(), null);
$this->assertInternalType('array', $oRow->getCells()); $this->assertInternalType('array', $oRow->getCells());
$this->assertCount(0, $oRow->getCells()); $this->assertCount(0, $oRow->getCells());
@ -60,7 +60,7 @@ class RowTest extends \PHPUnit_Framework_TestCase
$oRow = new Row('section', 1); $oRow = new Row('section', 1);
$element = $oRow->addCell(); $element = $oRow->addCell();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
$this->assertCount(1, $oRow->getCells()); $this->assertCount(1, $oRow->getCells());
} }
} }

View File

@ -75,7 +75,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
{ {
$oTable = new Table('section', 1); $oTable = new Table('section', 1);
$element = $oTable->addRow(); $element = $oTable->addRow();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Row', $element); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Row', $element);
$this->assertCount(1, $oTable->getRows()); $this->assertCount(1, $oTable->getRows());
} }
@ -87,6 +87,6 @@ class TableTest extends \PHPUnit_Framework_TestCase
$oTable = new Table('section', 1); $oTable = new Table('section', 1);
$oTable->addRow(); $oTable->addRow();
$element = $oTable->addCell(); $element = $oTable->addCell();
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Table\\Cell', $element); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Cell', $element);
} }
} }