-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Orkin/allow-add-custom-event-store
Allow to add a custom event store to AggregateRepository
- Loading branch information
Showing
4 changed files
with
204 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
/** | ||
* This file is part of the prooph/event-sourcing. | ||
* (c) 2014-2018 prooph software GmbH <contact@prooph.de> | ||
* (c) 2015-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ProophTest\EventSourcing\Mock; | ||
|
||
use Iterator; | ||
use Prooph\EventStore\EventStore; | ||
use Prooph\EventStore\Metadata\MetadataMatcher; | ||
use Prooph\EventStore\Stream; | ||
use Prooph\EventStore\StreamName; | ||
|
||
final class EventStoreMock implements EventStore | ||
{ | ||
public function updateStreamMetadata(StreamName $streamName, array $newMetadata): void | ||
{ | ||
} | ||
|
||
public function create(Stream $stream): void | ||
{ | ||
} | ||
|
||
public function appendTo(StreamName $streamName, Iterator $streamEvents): void | ||
{ | ||
} | ||
|
||
public function delete(StreamName $streamName): void | ||
{ | ||
} | ||
|
||
public function fetchStreamMetadata(StreamName $streamName): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function hasStream(StreamName $streamName): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function load( | ||
StreamName $streamName, | ||
int $fromNumber = 1, | ||
int $count = null, | ||
MetadataMatcher $metadataMatcher = null | ||
): Iterator { | ||
return new \ArrayIterator(); | ||
} | ||
|
||
public function loadReverse( | ||
StreamName $streamName, | ||
int $fromNumber = null, | ||
int $count = null, | ||
MetadataMatcher $metadataMatcher = null | ||
): Iterator { | ||
return new \ArrayIterator(); | ||
} | ||
|
||
/** | ||
* @return StreamName[] | ||
*/ | ||
public function fetchStreamNames( | ||
?string $filter, | ||
?MetadataMatcher $metadataMatcher, | ||
int $limit = 20, | ||
int $offset = 0 | ||
): array { | ||
return []; | ||
} | ||
|
||
/** | ||
* @return StreamName[] | ||
*/ | ||
public function fetchStreamNamesRegex( | ||
string $filter, | ||
?MetadataMatcher $metadataMatcher, | ||
int $limit = 20, | ||
int $offset = 0 | ||
): array { | ||
return []; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function fetchCategoryNames(?string $filter, int $limit = 20, int $offset = 0): array | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function fetchCategoryNamesRegex(string $filter, int $limit = 20, int $offset = 0): array | ||
{ | ||
return []; | ||
} | ||
} |