PhpSpreadsheet/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php

48 lines
1.3 KiB
PHP
Raw Normal View History

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