2017-09-08 17:56:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Style;
|
|
|
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Border;
|
2017-11-08 15:48:01 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2017-09-08 17:56:23 +00:00
|
|
|
|
2017-11-08 15:48:01 +00:00
|
|
|
class BorderTest extends TestCase
|
2017-09-08 17:56:23 +00:00
|
|
|
{
|
2020-05-18 04:49:57 +00:00
|
|
|
public function testCase(): void
|
2017-09-08 17:56:23 +00:00
|
|
|
{
|
|
|
|
$spreadsheet = new Spreadsheet();
|
|
|
|
$borders = $spreadsheet->getActiveSheet()->getStyle('A1')->getBorders();
|
|
|
|
$allBorders = $borders->getAllBorders();
|
|
|
|
$bottom = $borders->getBottom();
|
|
|
|
|
|
|
|
$actual = $bottom->getBorderStyle();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertSame(Border::BORDER_NONE, $actual, 'should default to none');
|
2017-09-08 17:56:23 +00:00
|
|
|
|
|
|
|
$allBorders->setBorderStyle(Border::BORDER_THIN);
|
|
|
|
|
|
|
|
$actual = $bottom->getBorderStyle();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertSame(Border::BORDER_THIN, $actual, 'should have been set via allBorders');
|
2017-09-08 17:56:23 +00:00
|
|
|
}
|
|
|
|
}
|