public function testCommitEmpty() { $identifier = EventStreamIdentifier::fromString('Foo'); $contract = Contract::fromClass(\stdClass::class); $this->persistence->expects($this->never())->method('commit'); $stream = EventStream::create($this->persistence, $contract, $identifier); $stream->commit(); }
public function testOpenExistingStream() { $contract = Contract::fromClass(\stdClass::class); $identifier = EventStreamIdentifier::fromString('Foo'); $this->persistence->expects($this->once())->method('fetch')->with($contract, $identifier)->willReturn([]); $stream = $this->eventStore->openStream($contract, $identifier); $this->assertInstanceOf(EventStream::class, $stream); $this->assertEquals([], $stream->all()); }
public function testIsNOtEqual() { $identifier = EventStreamIdentifier::fromString('Foo'); $this->assertTrue($identifier->equals(EventStreamIdentifier::fromString('Bar'))); }