Skip to content

Commit

Permalink
try to resolve bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Oct 20, 2018
1 parent 806d91c commit a59554f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ protected function given(): Generator
new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription {
private $deferred;
private $firstEvent;
private $set = false;

public function __construct($deferred, &$firstEvent)
{
Expand All @@ -85,8 +86,11 @@ public function __invoke(
ResolvedEvent $resolvedEvent,
?int $retryCount = null
): Promise {
$this->firstEvent = $resolvedEvent;
$this->deferred->resolve(true);
if (! $this->set) {
$this->set = true;
$this->firstEvent = $resolvedEvent;
$this->deferred->resolve(true);
}

return new Success();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/soft_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function soft_deleted_stream_allows_recreation_when_expver_is_exact(): vo
100,
false
);

\var_dump($result);
$this->assertTrue(SliceReadStatus::success()->equals($result->status()));
$this->assertSame(4, $result->lastEventNumber());
$this->assertCount(3, $result->events());
Expand Down

0 comments on commit a59554f

Please sign in to comment.