/**
  * @test
  * @covers ::findById
  */
 public function it_should_return_null_if_there_are_no_events_for_the_given_entity()
 {
     $streamUri = 'stream.id';
     $this->streamNameGenerator->shouldReceive('generate')->andReturn($streamUri);
     $this->eventStore->shouldReceive('forwardStreamFeedIterator')->once()->with($streamUri)->andReturn([]);
     $this->assertNull($this->repository->findById('1'));
 }
Ejemplo n.º 2
0
 /**
  * @test
  * @covers ::commit
  */
 public function it_should_do_nothing_on_commit()
 {
     $this->eventstore->shouldReceive('writeToStream')->never();
     $this->transaction->commit();
 }
 /**
  * @test
  * @covers ::commit
  * @covers ::push
  */
 public function it_should_not_commit_if_there_are_no_events()
 {
     $this->eventstore->shouldReceive('writeToStream')->never();
     $this->transaction->push('streamUri', []);
     $this->transaction->commit();
 }