spout/tests/Spout/Writer/Common/Manager/CellManagerTest.php
Adrien Loison 7274226b75 Row objects and Cell styling
This commit introduces Row and Cell entities, that will replace the arrays passed in previously.
It also adds support for Cell styling (instead of Row styling only).
2017-11-05 02:12:28 +01:00

29 lines
738 B
PHP

<?php
namespace Spout\Writer\Common\Manager;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
use Box\Spout\Writer\Common\Entity\Cell;
use Box\Spout\Writer\Common\Manager\CellManager;
use Box\Spout\Writer\Common\Manager\Style\StyleMerger;
use PHPUnit\Framework\TestCase;
class CellManagerTest extends TestCase
{
/**
* @return void
*/
public function testApplyStyle()
{
$cellManager = new CellManager(new StyleMerger());
$cell = new Cell('test');
$this->assertFalse($cell->getStyle()->isFontBold());
$style = (new StyleBuilder())->setFontBold()->build();
$cellManager->applyStyle($cell, $style);
$this->assertTrue($cell->getStyle()->isFontBold());
}
}