Files
oleibman ec773bbed9 Phpstan Bleeding Edge Part 2 of Many
This will be the biggest of these changes. It takes care of all of the remaining problems in tests. I will handle the problems in src more slowly.
2025-02-15 19:18:39 -08:00

57 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
use PhpOffice\PhpSpreadsheet\Helper\Dimension;
use PhpOffice\PhpSpreadsheet\Worksheet\RowDimension;
use PHPUnit\Framework\TestCase;
class RowDimensionTest extends TestCase
{
public function testInstantiateColumnDimensionDefault(): void
{
$expected = 0;
$rowDimension = new RowDimension();
$result = $rowDimension->getRowIndex();
self::assertEquals($expected, $result);
}
public function testGetAndSetColumnIndex(): void
{
$expected = 2;
$rowDimension = new RowDimension();
$rowDimension->setRowIndex($expected);
$result = $rowDimension->getRowIndex();
self::assertSame($expected, $result);
}
public function testGetAndSetHeight(): void
{
$expected = 1.2;
$columnDimension = new RowDimension();
$columnDimension->setRowHeight($expected);
$result = $columnDimension->getRowHeight();
self::assertSame($expected, $result);
$expectedPx = 32.0;
$expectedPt = 24.0;
$columnDimension->setRowHeight($expectedPx, Dimension::UOM_PIXELS);
$resultPx = $columnDimension->getRowHeight(Dimension::UOM_PIXELS);
self::assertSame($expectedPx, $resultPx);
$resultPt = $columnDimension->getRowHeight(Dimension::UOM_POINTS);
self::assertSame($expectedPt, $resultPt);
}
public function testRowZeroHeight(): void
{
$expected = true;
$rowDimension = new RowDimension();
$rowDimension->setZeroHeight($expected);
$result = $rowDimension->getZeroHeight();
self::assertTrue($result);
}
}