PhpSpreadsheet/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php
Adrien Crivelli aef4d711f5
Use self::assert*() instead of $this->assert*()
Because even if it doesn't make a difference in practice, it is
technically more correct to call static methods statically. It
also better advertise that those methods can be used from any context.
2017-09-22 14:22:44 +09:00

48 lines
1.3 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
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;
public function setUp()
{
$this->mockWorksheet = $this->getMockBuilder(Worksheet::class)
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestColumn')
->will($this->returnValue('E'));
}
public function testInstantiateRowDefault()
{
$row = new Row($this->mockWorksheet);
self::assertInstanceOf(Row::class, $row);
$rowIndex = $row->getRowIndex();
self::assertEquals(1, $rowIndex);
}
public function testInstantiateRowSpecified()
{
$row = new Row($this->mockWorksheet, 5);
self::assertInstanceOf(Row::class, $row);
$rowIndex = $row->getRowIndex();
self::assertEquals(5, $rowIndex);
}
public function testGetCellIterator()
{
$row = new Row($this->mockWorksheet);
$cellIterator = $row->getCellIterator();
self::assertInstanceOf(RowCellIterator::class, $cellIterator);
}
}