Files
kimai2/tests/Export/Spreadsheet/ColumnDefinitionTest.php
2025-08-11 18:57:42 +02:00

31 lines
855 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Export\Spreadsheet;
use App\Export\Spreadsheet\ColumnDefinition;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
#[CoversClass(ColumnDefinition::class)]
class ColumnDefinitionTest extends TestCase
{
public function testConstruct(): void
{
$sut = new ColumnDefinition('foo', 'bar', function () {
return 'hello world';
});
self::assertEquals('foo', $sut->getLabel());
self::assertEquals('bar', $sut->getType());
self::assertIsCallable($sut->getAccessor());
self::assertEquals('hello world', \call_user_func($sut->getAccessor()));
}
}