2019-06-26 00:39:05 +02:00
|
|
|
<?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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @covers \App\Entity\TimesheetMeta
|
|
|
|
*/
|
2024-12-22 01:25:30 +01:00
|
|
|
class TimesheetMetaTest extends AbstractMetaEntityTestCase
|
2019-06-26 00:39:05 +02:00
|
|
|
{
|
|
|
|
protected function getEntity(): EntityWithMetaFields
|
|
|
|
{
|
|
|
|
return new Timesheet();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getMetaEntity(): MetaTableTypeInterface
|
|
|
|
{
|
|
|
|
return new TimesheetMeta();
|
|
|
|
}
|
|
|
|
|
2024-02-07 23:47:25 +01:00
|
|
|
public function testSetEntityThrowsException(): void
|
2019-06-26 00:39:05 +02:00
|
|
|
{
|
2019-10-24 17:35:05 +02:00
|
|
|
$this->expectException(\InvalidArgumentException::class);
|
|
|
|
$this->expectExceptionMessage('Expected instanceof Timesheet, received "App\Entity\Project"');
|
|
|
|
|
2019-06-26 00:39:05 +02:00
|
|
|
$sut = new TimesheetMeta();
|
|
|
|
$sut->setEntity(new Project());
|
|
|
|
}
|
|
|
|
}
|