added tags for timesheets (#604)

This commit is contained in:
Mathias
2019-05-12 01:40:04 +02:00
committed by Kevin Papst
parent f31118292c
commit e29e183e84
84 changed files with 2132 additions and 158 deletions

View File

@@ -13,6 +13,7 @@ use App\Calendar\TimesheetEntity;
use App\Entity\Activity;
use App\Entity\Customer;
use App\Entity\Project;
use App\Entity\Tag;
use App\Entity\Timesheet;
use PHPUnit\Framework\TestCase;
@@ -36,12 +37,15 @@ class TimesheetEntityTest extends TestCase
$timesheet = new Timesheet();
$timesheet->setActivity($activity);
$timesheet->setProject($project);
$timesheet->addTag((new Tag())->setName('foo'));
$timesheet->addTag((new Tag())->setName('bar'));
$sut = new TimesheetEntity($timesheet);
$this->assertEquals('customer', $sut->getCustomer());
$this->assertEquals('project', $sut->getProject());
$this->assertEquals('activity', $sut->getTitle());
$this->assertEquals('foo, bar', $sut->getTags());
$sut->setId(13);
$this->assertEquals(13, $sut->getId());
@@ -66,6 +70,9 @@ class TimesheetEntityTest extends TestCase
$sut->setActivity('cccccccc');
$this->assertEquals('cccccccc', $sut->getActivity());
$sut->setTags('hello, world');
$this->assertEquals('hello, world', $sut->getTags());
$this->assertNull($sut->getBorderColor());
$sut->setBorderColor('#cccccc');
$this->assertEquals('#cccccc', $sut->getBorderColor());