Files
kimai2/tests/Export/Spreadsheet/ColumnDefinitionTest.php
2025-09-23 18:32:31 +02:00

35 lines
1.0 KiB
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('messages', $sut->getTranslationDomain());
self::assertEquals('foo', $sut->getLabel());
self::assertEquals('bar', $sut->getType());
self::assertIsCallable($sut->getAccessor());
self::assertEquals('hello world', \call_user_func($sut->getAccessor()));
$sut->setTranslationDomain('foo');
self::assertEquals('foo', $sut->getTranslationDomain());
}
}