| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 30 | public function testAggregate() |
||
| 31 | { |
||
| 32 | $this |
||
| 33 | ->given( |
||
| 34 | $post = PostEventSourcedFactory::create( |
||
| 35 | $this->faker->sentence, |
||
| 36 | $this->faker->paragraph |
||
| 37 | ) |
||
| 38 | ) |
||
| 39 | ->and($postId = PostId::fromNative(md5(rand()))) |
||
| 40 | ->and($streamName = 'Posts-'.$postId) |
||
| 41 | ->and($eventStream = new EventStream($streamName, $postId, [])) |
||
| 42 | ->and($event = new PostPersistEvent($post, $eventStream)) |
||
| 43 | ->then() |
||
| 44 | ->object($event->aggregate()) |
||
| 45 | ->isEqualTo($post) |
||
| 46 | ->object($event->eventStream()) |
||
| 47 | ->isEqualTo($eventStream) |
||
| 48 | ; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |