PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/BorderTest.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

27 lines
813 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Style;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PHPUnit_Framework_TestCase;
class BorderTest extends PHPUnit_Framework_TestCase
{
public function testCase()
{
$spreadsheet = new Spreadsheet();
$borders = $spreadsheet->getActiveSheet()->getStyle('A1')->getBorders();
$allBorders = $borders->getAllBorders();
$bottom = $borders->getBottom();
$actual = $bottom->getBorderStyle();
self::assertSame(Border::BORDER_NONE, $actual, 'should default to none');
$allBorders->setBorderStyle(Border::BORDER_THIN);
$actual = $bottom->getBorderStyle();
self::assertSame(Border::BORDER_THIN, $actual, 'should have been set via allBorders');
}
}