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

42 lines
1.3 KiB
PHP
Raw Normal View History

<?php
class WorksheetColumnTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockColumn;
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('getHighestRow')
->will($this->returnValue(5));
}
2015-05-17 13:00:02 +00:00
public function testInstantiateColumnDefault()
{
2016-03-22 14:19:00 +00:00
$column = new \PHPExcel\Worksheet\Column($this->mockWorksheet);
$this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column);
$columnIndex = $column->getColumnIndex();
$this->assertEquals('A', $columnIndex);
2015-05-17 13:00:02 +00:00
}
2015-05-17 13:00:02 +00:00
public function testInstantiateColumnSpecified()
{
2016-03-22 14:19:00 +00:00
$column = new \PHPExcel\Worksheet\Column($this->mockWorksheet, 'E');
$this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column);
$columnIndex = $column->getColumnIndex();
$this->assertEquals('E', $columnIndex);
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
$column = new \PHPExcel\Worksheet\Column($this->mockWorksheet);
$cellIterator = $column->getCellIterator();
2016-03-22 14:19:00 +00:00
$this->assertInstanceOf('\PHPExcel\Worksheet\ColumnCellIterator', $cellIterator);
2015-05-17 13:00:02 +00:00
}
}