| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | public function testShouldCreateSnapshot() |
||
| 28 | { |
||
| 29 | $this |
||
| 30 | ->given($policy = new EventsBasedSnapshottingPolicy()) |
||
| 31 | ->and( |
||
| 32 | $post = PostEventSourcedFactory::create( |
||
| 33 | $this->faker->sentence, |
||
| 34 | $this->faker->paragraph |
||
| 35 | ) |
||
| 36 | ) |
||
| 37 | ->then() |
||
| 38 | ->boolean($policy->shouldCreateSnapshot($post)) |
||
| 39 | ->isTrue() |
||
| 40 | ->and() |
||
| 41 | ->when($post->clearEvents()) |
||
| 42 | ->then() |
||
| 43 | ->boolean($policy->shouldCreateSnapshot($post)) |
||
| 44 | ->isFalse() |
||
| 45 | ; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |