mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-21 01:40:44 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Table;
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Table\TableStyle;
|
|
|
|
class TableStyleTest extends SetupTeardown
|
|
{
|
|
private const INITIAL_RANGE = 'H2:O256';
|
|
|
|
public function testVariousSets(): void
|
|
{
|
|
$table = new Table(self::INITIAL_RANGE);
|
|
$style = $table->getStyle();
|
|
|
|
$result = $style->setTheme(TableStyle::TABLE_STYLE_DARK1);
|
|
self::assertInstanceOf(TableStyle::class, $result);
|
|
self::assertEquals(TableStyle::TABLE_STYLE_DARK1, $style->getTheme());
|
|
|
|
$result = $style->setShowFirstColumn(true);
|
|
self::assertInstanceOf(TableStyle::class, $result);
|
|
self::assertTrue($style->getShowFirstColumn());
|
|
|
|
$result = $style->setShowLastColumn(true);
|
|
self::assertInstanceOf(TableStyle::class, $result);
|
|
self::assertTrue($style->getShowLastColumn());
|
|
|
|
$result = $style->setShowRowStripes(true);
|
|
self::assertInstanceOf(TableStyle::class, $result);
|
|
self::assertTrue($style->getShowRowStripes());
|
|
|
|
$result = $style->setShowColumnStripes(true);
|
|
self::assertInstanceOf(TableStyle::class, $result);
|
|
self::assertTrue($style->getShowColumnStripes());
|
|
}
|
|
|
|
public function testTable(): void
|
|
{
|
|
$table = new Table(self::INITIAL_RANGE);
|
|
$style = new TableStyle();
|
|
$style->setTable($table);
|
|
self::assertEquals($table, $style->getTable());
|
|
}
|
|
}
|