Skip to content

Commit

Permalink
fix invalid message property behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed May 22, 2017
1 parent 2280ac1 commit d261b80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/InMemoryEventStore.php
Expand Up @@ -490,7 +490,7 @@ private function matchesMessagesProperty(MetadataMatcher $metadataMatcher, Messa
$value = $message->createdAt()->format('Y-m-d\TH:i:s.u');
break;
default:
throw new \UnexpectedValueException(sprintf('Unexpected field "%s" given', $match['field']));
return false;
}

if (! $this->match($match['operator'], $value, $match['value'])) {
Expand Down
4 changes: 1 addition & 3 deletions tests/AbstractEventStoreTest.php
Expand Up @@ -1132,10 +1132,8 @@ public function it_throws_exception_given_invalid_metadata_value(): void
/**
* @test
*/
public function it_throws_on_invalid_field_for_message_property(): void
public function it_ignores_invalid_field_for_message_property(): void
{
$this->expectException(\UnexpectedValueException::class);

$event = UserCreated::with(['name' => 'John'], 1);
$event = $event->withAddedMetadata('foo', 'bar');
$event = $event->withAddedMetadata('int', 5);
Expand Down

0 comments on commit d261b80

Please sign in to comment.