spout/tests/Spout/Writer/Common/Manager/RowManagerTest.php
2021-09-18 18:09:14 +02:00

41 lines
988 B
PHP

<?php
namespace Spout\Writer\Common\Manager;
use Box\Spout\Common\Entity\Cell;
use Box\Spout\Common\Entity\Row;
use Box\Spout\Writer\Common\Manager\RowManager;
use PHPUnit\Framework\TestCase;
class RowManagerTest extends TestCase
{
/**
* @return array<mixed>
*/
public function dataProviderForTestIsEmptyRow()
{
return [
// cells, expected isEmpty
[[], true],
[[new Cell('')], true],
[[new Cell(''), new Cell('')], true],
[[new Cell(''), new Cell(''), new Cell('Okay')], false],
];
}
/**
* @dataProvider dataProviderForTestIsEmptyRow
*
* @param array<Cell> $cells
* @param bool $expectedIsEmpty
* @return void
*/
public function testIsEmptyRow(array $cells, $expectedIsEmpty)
{
$rowManager = new RowManager();
$row = new Row($cells, null);
$this->assertEquals($expectedIsEmpty, $rowManager->isEmpty($row));
}
}