2015-04-26 12:00:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class WorksheetRowTest extends PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public $mockWorksheet;
|
|
|
|
public $mockRow;
|
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
if (!defined('PHPEXCEL_ROOT')) {
|
|
|
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
|
|
|
}
|
|
|
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
2015-04-26 12:00:58 +00:00
|
|
|
|
|
|
|
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2015-04-27 21:47:47 +00:00
|
|
|
$this->mockWorksheet->expects($this->any())
|
|
|
|
->method('getHighestColumn')
|
|
|
|
->will($this->returnValue('E'));
|
2015-04-26 12:00:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testInstantiateRowDefault()
|
|
|
|
{
|
2015-04-26 12:00:58 +00:00
|
|
|
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
|
|
|
|
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
|
|
|
|
$rowIndex = $row->getRowIndex();
|
|
|
|
$this->assertEquals(1, $rowIndex);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2015-04-26 12:00:58 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testInstantiateRowSpecified()
|
|
|
|
{
|
2015-04-26 12:00:58 +00:00
|
|
|
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet, 5);
|
|
|
|
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
|
|
|
|
$rowIndex = $row->getRowIndex();
|
|
|
|
$this->assertEquals(5, $rowIndex);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2015-04-26 12:00:58 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetCellIterator()
|
|
|
|
{
|
2015-04-26 12:00:58 +00:00
|
|
|
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
|
|
|
|
$cellIterator = $row->getCellIterator();
|
2015-04-27 21:47:47 +00:00
|
|
|
$this->assertInstanceOf('PHPExcel_Worksheet_RowCellIterator', $cellIterator);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2015-04-26 12:00:58 +00:00
|
|
|
}
|