Add test for PhpOffice\PhpSpreadsheet\Worksheet\ColumnDimension
This commit is contained in:
parent
5435fe8025
commit
7f5e0f0a37
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\ColumnDimension;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ColumnDimensionTest extends TestCase
|
||||
{
|
||||
public function testInstantiateColumnDimensionDefault()
|
||||
{
|
||||
$expected = 'A';
|
||||
$columnDimension = new ColumnDimension();
|
||||
self::assertInstanceOf(ColumnDimension::class, $columnDimension);
|
||||
$result = $columnDimension->getColumnIndex();
|
||||
self::assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testGetAndSetColumnIndex()
|
||||
{
|
||||
$expected = 'B';
|
||||
$columnDimension = new ColumnDimension();
|
||||
$columnDimension->setColumnIndex($expected);
|
||||
$result = $columnDimension->getColumnIndex();
|
||||
self::assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testGetAndSetWidth()
|
||||
{
|
||||
$expected = 1.2;
|
||||
$columnDimension = new ColumnDimension();
|
||||
$columnDimension->setWidth($expected);
|
||||
$result = $columnDimension->getWidth();
|
||||
self::assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testGetAndSetAutoSize()
|
||||
{
|
||||
$expected = true;
|
||||
$columnDimension = new ColumnDimension();
|
||||
$columnDimension->setAutoSize($expected);
|
||||
$result = $columnDimension->getAutoSize();
|
||||
self::assertSame($expected, $result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue