-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BugTest.php
67 lines (61 loc) · 2.19 KB
/
BugTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace Tienvx\Bundle\MbtBundle\Tests\Model;
use PHPUnit\Framework\TestCase;
use SingleColorPetrinet\Model\Color;
use Tienvx\Bundle\MbtBundle\Entity\Progress;
use Tienvx\Bundle\MbtBundle\Entity\Task;
use Tienvx\Bundle\MbtBundle\Model\Bug;
use Tienvx\Bundle\MbtBundle\Model\BugInterface;
use Tienvx\Bundle\MbtBundle\Model\ProgressInterface;
use Tienvx\Bundle\MbtBundle\Model\TaskInterface;
use Tienvx\Bundle\MbtBundle\ValueObject\Bug\Step;
/**
* @covers \Tienvx\Bundle\MbtBundle\Model\Bug
*
* @uses \Tienvx\Bundle\MbtBundle\Entity\Task
* @uses \Tienvx\Bundle\MbtBundle\Model\Task
* @uses \Tienvx\Bundle\MbtBundle\ValueObject\Bug\Step
* @uses \Tienvx\Bundle\MbtBundle\Model\Bug\Step
* @uses \Tienvx\Bundle\MbtBundle\Entity\Progress
* @uses \Tienvx\Bundle\MbtBundle\Model\Progress
*/
class BugTest extends TestCase
{
protected BugInterface $bug;
protected array $steps;
protected TaskInterface $task;
protected ProgressInterface $progress;
protected function setUp(): void
{
$this->steps = [
new Step([], new Color(), 0),
new Step([], new Color(), 1),
];
$this->task = new Task();
$this->progress = new Progress();
$this->bug = $this->createBug();
$this->bug->setId(123);
$this->bug->setTitle('bug title');
$this->bug->setSteps($this->steps);
$this->bug->setTask($this->task);
$this->bug->setMessage('bug message');
$this->bug->setProgress($this->progress);
$this->bug->setClosed(true);
$this->bug->setRecording(true);
}
public function testProperties(): void
{
$this->assertSame(123, $this->bug->getId());
$this->assertSame('bug title', $this->bug->getTitle());
$this->assertSame($this->steps, $this->bug->getSteps());
$this->assertSame($this->task, $this->bug->getTask());
$this->assertSame('bug message', $this->bug->getMessage());
$this->assertSame($this->progress, $this->bug->getProgress());
$this->assertSame(true, $this->bug->isClosed());
$this->assertSame(true, $this->bug->isRecording());
}
protected function createBug(): BugInterface
{
return new Bug();
}
}