WorkLogEntryTest::testAccessors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 18
rs 9.8333
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJiraTest\Entity;
5
6
use PHPUnit\Framework\TestCase;
7
use TogglJira\Entity\WorkLogEntry;
8
9
class WorkLogEntryTest extends TestCase
10
{
11
    /**
12
     * @var WorkLogEntry
13
     */
14
    private $entity;
15
16
    /**
17
     * @return void
18
     */
19
    public function setUp(): void
20
    {
21
        $this->entity = new WorkLogEntry();
22
    }
23
24
    /**
25
     * @throws \Exception
26
     * @return void
27
     */
28
    public function testAccessors(): void
29
    {
30
        $data = [
31
            'issueID' => 'TST-01',
32
            'timeSpent' => 666,
33
            'comment' => 'This is a test',
34
            'spentOn' => new \DateTimeImmutable()
35
        ];
36
37
        $this->entity->setIssueID($data['issueID']);
38
        $this->entity->setTimeSpent($data['timeSpent']);
39
        $this->entity->setComment($data['comment']);
40
        $this->entity->setSpentOn($data['spentOn']);
41
42
        $this->assertEquals($data['issueID'], $this->entity->getIssueID());
43
        $this->assertEquals($data['timeSpent'], $this->entity->getTimeSpent());
44
        $this->assertEquals($data['comment'], $this->entity->getComment());
45
        $this->assertEquals($data['spentOn'], $this->entity->getSpentOn());
46
    }
47
}
48