PhpSpreadsheet/unitTests/Classes/src/Worksheet/WorksheetRowTest.php

42 lines
1.2 KiB
PHP
Raw Normal View History

<?php
class WorksheetRowTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockRow;
2015-05-17 13:00:02 +00:00
public function setUp()
{
2016-03-22 14:19:00 +00:00
$this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestColumn')
->will($this->returnValue('E'));
}
2015-05-17 13:00:02 +00:00
public function testInstantiateRowDefault()
{
2016-03-22 14:19:00 +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-05-17 13:00:02 +00:00
public function testInstantiateRowSpecified()
{
2016-03-22 14:19:00 +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-05-17 13:00:02 +00:00
public function testGetCellIterator()
{
2016-03-22 14:19:00 +00:00
$row = new \PHPExcel\Worksheet\Row($this->mockWorksheet);
$cellIterator = $row->getCellIterator();
2016-03-22 14:19:00 +00:00
$this->assertInstanceOf('\PHPExcel\Worksheet\RowCellIterator', $cellIterator);
2015-05-17 13:00:02 +00:00
}
}