TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskEditedSpec.php 1 location
|
@@ 23-40 (lines=18) @@
|
20 |
|
use Kreta\TaskManager\Domain\Model\Project\Task\TaskTitle; |
21 |
|
use PhpSpec\ObjectBehavior; |
22 |
|
|
23 |
|
class TaskEditedSpec extends ObjectBehavior |
24 |
|
{ |
25 |
|
function let(TaskId $taskId, TaskTitle $title) |
26 |
|
{ |
27 |
|
$this->beConstructedWith($taskId, $title, 'Description'); |
28 |
|
} |
29 |
|
|
30 |
|
function it_creates_a_task_edited_event(TaskId $taskId, TaskTitle $title) |
31 |
|
{ |
32 |
|
$this->shouldHaveType(TaskEdited::class); |
33 |
|
$this->shouldImplement(DomainEvent::class); |
34 |
|
|
35 |
|
$this->id()->shouldReturn($taskId); |
36 |
|
$this->title()->shouldReturn($title); |
37 |
|
$this->description()->shouldReturn('Description'); |
38 |
|
$this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
39 |
|
} |
40 |
|
} |
41 |
|
|
TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskPriorityChangedSpec.php 1 location
|
@@ 23-39 (lines=17) @@
|
20 |
|
use Kreta\TaskManager\Domain\Model\Project\Task\TaskPriorityChanged; |
21 |
|
use PhpSpec\ObjectBehavior; |
22 |
|
|
23 |
|
class TaskPriorityChangedSpec extends ObjectBehavior |
24 |
|
{ |
25 |
|
function let(TaskId $taskId, TaskPriority $priority) |
26 |
|
{ |
27 |
|
$this->beConstructedWith($taskId, $priority); |
28 |
|
} |
29 |
|
|
30 |
|
function it_creates_task_started_event(TaskId $taskId, TaskPriority $priority) |
31 |
|
{ |
32 |
|
$this->shouldHaveType(TaskPriorityChanged::class); |
33 |
|
$this->shouldImplement(DomainEvent::class); |
34 |
|
|
35 |
|
$this->id()->shouldReturn($taskId); |
36 |
|
$this->priority()->shouldReturn($priority); |
37 |
|
$this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
38 |
|
} |
39 |
|
} |
40 |
|
|
TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskProgressChangedSpec.php 1 location
|
@@ 23-39 (lines=17) @@
|
20 |
|
use Kreta\TaskManager\Domain\Model\Project\Task\TaskProgressChanged; |
21 |
|
use PhpSpec\ObjectBehavior; |
22 |
|
|
23 |
|
class TaskProgressChangedSpec extends ObjectBehavior |
24 |
|
{ |
25 |
|
function let(TaskId $taskId, TaskProgress $progress) |
26 |
|
{ |
27 |
|
$this->beConstructedWith($taskId, $progress); |
28 |
|
} |
29 |
|
|
30 |
|
function it_creates_task_started_event(TaskId $taskId, TaskProgress $progress) |
31 |
|
{ |
32 |
|
$this->shouldHaveType(TaskProgressChanged::class); |
33 |
|
$this->shouldImplement(DomainEvent::class); |
34 |
|
|
35 |
|
$this->id()->shouldReturn($taskId); |
36 |
|
$this->progress()->shouldReturn($progress); |
37 |
|
$this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
38 |
|
} |
39 |
|
} |
40 |
|
|
TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskReporterChangedSpec.php 1 location
|
@@ 23-36 (lines=14) @@
|
20 |
|
use Kreta\TaskManager\Domain\Model\Project\Task\TaskReporterChanged; |
21 |
|
use PhpSpec\ObjectBehavior; |
22 |
|
|
23 |
|
class TaskReporterChangedSpec extends ObjectBehavior |
24 |
|
{ |
25 |
|
function it_can_created_an_event(TaskId $taskId, MemberId $reporterId) |
26 |
|
{ |
27 |
|
$this->beConstructedWith($taskId, $reporterId); |
28 |
|
|
29 |
|
$this->shouldHaveType(TaskReporterChanged::class); |
30 |
|
$this->shouldImplement(DomainEvent::class); |
31 |
|
|
32 |
|
$this->id()->shouldReturn($taskId); |
33 |
|
$this->reporterId()->shouldReturn($reporterId); |
34 |
|
$this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
35 |
|
} |
36 |
|
} |
37 |
|
|