|
@@ 86-105 (lines=20) @@
|
| 83 |
|
$this->shouldHavePublished(UserReceivedNotification::class); |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
function it_reads_notification( |
| 87 |
|
EventStream $stream, |
| 88 |
|
UserId $id, |
| 89 |
|
UserSignedUp $userSignedUp, |
| 90 |
|
DomainEventCollection $collection, |
| 91 |
|
Notification $notification, |
| 92 |
|
NotificationId $notificationId, |
| 93 |
|
UserReceivedNotification $userReceivedNotification |
| 94 |
|
) { |
| 95 |
|
$collection->toArray()->willReturn([ |
| 96 |
|
$userSignedUp, |
| 97 |
|
$userReceivedNotification, |
| 98 |
|
]); |
| 99 |
|
$stream->events()->willReturn($collection); |
| 100 |
|
$stream->aggregateRootId()->shouldBeCalled()->willReturn($id); |
| 101 |
|
$this->beConstructedReconstitute($stream); |
| 102 |
|
$notification->id()->shouldBeCalled()->willReturn($notificationId); |
| 103 |
|
$this->readNotification($notification); |
| 104 |
|
$this->shouldHavePublished(UserReadNotification::class); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
function it_unreads_notification( |
| 108 |
|
EventStream $stream, |
|
@@ 107-128 (lines=22) @@
|
| 104 |
|
$this->shouldHavePublished(UserReadNotification::class); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
function it_unreads_notification( |
| 108 |
|
EventStream $stream, |
| 109 |
|
UserId $id, |
| 110 |
|
UserSignedUp $userSignedUp, |
| 111 |
|
DomainEventCollection $collection, |
| 112 |
|
Notification $notification, |
| 113 |
|
NotificationId $notificationId, |
| 114 |
|
UserReceivedNotification $userReceivedNotification, |
| 115 |
|
UserReadNotification $userReadNotification |
| 116 |
|
) { |
| 117 |
|
$collection->toArray()->willReturn([ |
| 118 |
|
$userSignedUp, |
| 119 |
|
$userReceivedNotification, |
| 120 |
|
$userReadNotification, |
| 121 |
|
]); |
| 122 |
|
$stream->events()->willReturn($collection); |
| 123 |
|
$stream->aggregateRootId()->shouldBeCalled()->willReturn($id); |
| 124 |
|
$this->beConstructedReconstitute($stream); |
| 125 |
|
$notification->id()->shouldBeCalled()->willReturn($notificationId); |
| 126 |
|
$this->unreadNotification($notification); |
| 127 |
|
$this->shouldHavePublished(UserUnreadNotification::class); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
function it_does_not_get_notification_when_it_does_not_exist( |
| 131 |
|
EventStream $stream, |