Files
kimai2/tests/Entity/TimesheetMetaTest.php
2025-08-11 18:57:42 +02:00

41 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\Entity;
use App\Entity\EntityWithMetaFields;
use App\Entity\MetaTableTypeInterface;
use App\Entity\Project;
use App\Entity\Timesheet;
use App\Entity\TimesheetMeta;
use PHPUnit\Framework\Attributes\CoversClass;
#[CoversClass(TimesheetMeta::class)]
class TimesheetMetaTest extends AbstractMetaEntityTestCase
{
protected function getEntity(): EntityWithMetaFields
{
return new Timesheet();
}
protected function getMetaEntity(): MetaTableTypeInterface
{
return new TimesheetMeta();
}
public function testSetEntityThrowsException(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Expected instanceof Timesheet, received "App\Entity\Project"');
$sut = new TimesheetMeta();
$sut->setEntity(new Project());
}
}