Skip to content

Commit

Permalink
add test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed May 22, 2017
1 parent d261b80 commit 2d2beb5
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tests/AbstractEventStoreTest.php
Expand Up @@ -13,6 +13,7 @@
namespace ProophTest\EventStore;

use ArrayIterator;
use EmptyIterator;
use PHPUnit\Framework\TestCase;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\Exception\InvalidArgumentException;
Expand Down Expand Up @@ -1005,14 +1006,14 @@ public function it_fetches_stream_names(): void
for ($i = 0; $i < 50; $i++) {
$streamNames[] = 'user-' . $i;
$streamNames[] = 'admin-' . $i;
$this->eventStore->create(new Stream(new StreamName('user-' . $i), new \EmptyIterator(), ['foo' => 'bar']));
$this->eventStore->create(new Stream(new StreamName('admin-' . $i), new \EmptyIterator(), ['foo' => 'bar']));
$this->eventStore->create(new Stream(new StreamName('user-' . $i), new EmptyIterator(), ['foo' => 'bar']));
$this->eventStore->create(new Stream(new StreamName('admin-' . $i), new EmptyIterator(), ['foo' => 'bar']));
}

for ($i = 0; $i < 20; $i++) {
$streamName = uniqid('rand');
$streamNames[] = $streamName;
$this->eventStore->create(new Stream(new StreamName($streamName), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName($streamName), new EmptyIterator()));
}

$this->assertCount(1, $this->eventStore->fetchStreamNames('user-0', null, 200, 0));
Expand Down Expand Up @@ -1073,19 +1074,19 @@ public function it_fetches_stream_categories(): void
$streamNames[] = 'foobar-' . $i;
$streamNames[] = 'foobaz-' . $i;
$streamNames[] = 'foobam-' . $i;
$this->eventStore->create(new Stream(new StreamName('foo-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('bar-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('baz-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('bam-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobar-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobaz-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobam-' . $i), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foo-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('bar-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('baz-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('bam-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobar-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobaz-' . $i), new EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName('foobam-' . $i), new EmptyIterator()));
}

for ($i = 0; $i < 20; $i++) {
$streamName = uniqid('rand');
$streamNames[] = $streamName;
$this->eventStore->create(new Stream(new StreamName($streamName), new \EmptyIterator()));
$this->eventStore->create(new Stream(new StreamName($streamName), new EmptyIterator()));
}

$this->assertCount(7, $this->eventStore->fetchCategoryNames(null, 20, 0));
Expand Down Expand Up @@ -1154,7 +1155,9 @@ public function it_ignores_invalid_field_for_message_property(): void
'fieldType' => FieldType::MESSAGE_PROPERTY(),
]])->shouldBeCalled();

$this->eventStore->load($streamName, 1, null, $metadataMatcher->reveal());
$streamEvents = $this->eventStore->load($streamName, 1, null, $metadataMatcher->reveal());

$this->assertFalse($streamEvents->valid());
}

public function getMatchingMetadata(): array
Expand Down

0 comments on commit 2d2beb5

Please sign in to comment.