diff --git a/tests/CloudEventSignatureTest.php b/tests/CloudEventSignatureTest.php index fbb69fe..e3ded39 100755 --- a/tests/CloudEventSignatureTest.php +++ b/tests/CloudEventSignatureTest.php @@ -38,7 +38,7 @@ public function testThrowsAnErrorIfTheSignatureIsNull(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $client->writeEvents([ @@ -76,7 +76,7 @@ public function testThrowsAnErrorIfTheHashVerificationFails(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $client->writeEvents([ @@ -131,7 +131,7 @@ public function testThrowsAnErrorIfTheSignatureVerificationFails(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $client->writeEvents([ @@ -186,7 +186,7 @@ public function testVerifiesTheSignature(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $client->writeEvents([ diff --git a/tests/CloudEventTest.php b/tests/CloudEventTest.php index f9f4704..91e4f2a 100755 --- a/tests/CloudEventTest.php +++ b/tests/CloudEventTest.php @@ -21,7 +21,7 @@ public function testVerifiesTheEventHash(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $this->client->writeEvents([ @@ -47,7 +47,7 @@ public function testThrowsAnErrorIfTheEventHashIsInvalid(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $writtenEvents = $this->client->writeEvents([ diff --git a/tests/ObserveEventsTest.php b/tests/ObserveEventsTest.php index 03590a9..0ad6020 100755 --- a/tests/ObserveEventsTest.php +++ b/tests/ObserveEventsTest.php @@ -39,7 +39,7 @@ public function testObserverAllEventsFromTheGivenSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -48,7 +48,7 @@ public function testObserverAllEventsFromTheGivenSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -77,7 +77,7 @@ public function testObserversRecursively(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -86,7 +86,7 @@ public function testObserversRecursively(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -115,7 +115,7 @@ public function testObserversWithLowerBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -124,7 +124,7 @@ public function testObserversWithLowerBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -160,7 +160,7 @@ public function testObserversFromLatestEvent(): void type: 'io.eventsourcingdb.test.foo', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -169,7 +169,7 @@ public function testObserversFromLatestEvent(): void type: 'io.eventsourcingdb.test.bar', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -206,7 +206,7 @@ public function testObserverAllEventsWithAbortInLoop(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -215,7 +215,7 @@ public function testObserverAllEventsWithAbortInLoop(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -249,7 +249,7 @@ public function testObserverAllEventsPerformanceBenchmark(): void type: 'io.eventsourcingdb.test', data: [ 'value' => rand(1000, 9999), - ], + ] ); } diff --git a/tests/ReadEventTypeTest.php b/tests/ReadEventTypeTest.php index 30917cf..1412b42 100755 --- a/tests/ReadEventTypeTest.php +++ b/tests/ReadEventTypeTest.php @@ -33,7 +33,7 @@ public function testReadAnExistingEventType(): void type: 'io.eventsourcingdb.test.foo', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -42,7 +42,7 @@ public function testReadAnExistingEventType(): void type: 'io.eventsourcingdb.test.bar', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ diff --git a/tests/ReadEventTypesTest.php b/tests/ReadEventTypesTest.php index 157ab2c..8bc4793 100755 --- a/tests/ReadEventTypesTest.php +++ b/tests/ReadEventTypesTest.php @@ -30,7 +30,7 @@ public function testReadsAllEventTypes(): void type: 'io.eventsourcingdb.test.foo', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -39,7 +39,7 @@ public function testReadsAllEventTypes(): void type: 'io.eventsourcingdb.test.bar', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -70,8 +70,8 @@ public function testSupportsReadingEventSchemas(): void 'properties' => [ 'value' => [ 'type' => 'number', - ], - ], + ] + ] 'required' => ['value'], 'additionalProperties' => false, ]; diff --git a/tests/ReadEventsTest.php b/tests/ReadEventsTest.php index 96d16ef..ed4046b 100644 --- a/tests/ReadEventsTest.php +++ b/tests/ReadEventsTest.php @@ -37,7 +37,7 @@ public function testReadsAllEventsFromTheGivenSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -46,7 +46,7 @@ public function testReadsAllEventsFromTheGivenSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -72,7 +72,7 @@ public function testReadsRecursively(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -81,7 +81,7 @@ public function testReadsRecursively(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -107,7 +107,7 @@ public function testReadsChronologically(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -116,7 +116,7 @@ public function testReadsChronologically(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -151,7 +151,7 @@ public function testReadsAntiChronologically(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -160,7 +160,7 @@ public function testReadsAntiChronologically(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -195,7 +195,7 @@ public function testReadsWithLowerBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -204,7 +204,7 @@ public function testReadsWithLowerBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -236,7 +236,7 @@ public function testReadsWithUpperBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -245,7 +245,7 @@ public function testReadsWithUpperBound(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -277,7 +277,7 @@ public function testReadsFromLatestEvent(): void type: 'io.eventsourcingdb.test.foo', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -286,7 +286,7 @@ public function testReadsFromLatestEvent(): void type: 'io.eventsourcingdb.test.bar', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ diff --git a/tests/ReadSubjectsTest.php b/tests/ReadSubjectsTest.php index de3788f..1041e44 100644 --- a/tests/ReadSubjectsTest.php +++ b/tests/ReadSubjectsTest.php @@ -28,7 +28,7 @@ public function testReadsAllSubjects(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -37,7 +37,7 @@ public function testReadsAllSubjects(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -65,7 +65,7 @@ public function testReadsAllSubjectsFromTheBaseSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -74,7 +74,7 @@ public function testReadsAllSubjectsFromTheBaseSubject(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ diff --git a/tests/RegisterEventSchemaTest.php b/tests/RegisterEventSchemaTest.php index 0305b2d..a5541c6 100644 --- a/tests/RegisterEventSchemaTest.php +++ b/tests/RegisterEventSchemaTest.php @@ -17,8 +17,8 @@ public function testRegisterAnEventSchema(): void 'properties' => [ 'value' => [ 'type' => 'number', - ], - ], + ] + ] 'required' => ['value'], 'additionalProperties' => false, ]; @@ -36,8 +36,8 @@ public function testThrowsAnErrorIfAnEventSchemaIsAlreadyRegistered(): void 'properties' => [ 'value' => [ 'type' => 'number', - ], - ], + ] + ] 'required' => ['value'], 'additionalProperties' => false, ]; diff --git a/tests/RunEventQlQueryTest.php b/tests/RunEventQlQueryTest.php index b60be06..c0e80da 100644 --- a/tests/RunEventQlQueryTest.php +++ b/tests/RunEventQlQueryTest.php @@ -28,7 +28,7 @@ public function testReadsAllRowsTheQueryReturn(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -37,7 +37,7 @@ public function testReadsAllRowsTheQueryReturn(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ diff --git a/tests/WriteEventsTest.php b/tests/WriteEventsTest.php index 5a24fe4..9e95dcd 100644 --- a/tests/WriteEventsTest.php +++ b/tests/WriteEventsTest.php @@ -23,7 +23,7 @@ public function testWritesASingleEvent(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $writtenEvents = $this->client->writeEvents([ @@ -43,7 +43,7 @@ public function testWritesMultipleEvents(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -52,7 +52,7 @@ public function testWritesMultipleEvents(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $writtenEvents = $this->client->writeEvents([ @@ -77,7 +77,7 @@ public function testSupportsTheIsSubjectPristinePrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $this->client->writeEvents([ @@ -90,7 +90,7 @@ public function testSupportsTheIsSubjectPristinePrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->expectExceptionMessage("Failed to write events, got HTTP status code '409', expected '200'"); @@ -98,10 +98,10 @@ public function testSupportsTheIsSubjectPristinePrecondition(): void $this->client->writeEvents( [ $secondEvent, - ], + ] [ new IsSubjectPristine('/test'), - ], + ] ); } @@ -113,7 +113,7 @@ public function testRejectsWritingToEmptySubjectWhenUsingTheIsSubjectPopulatedPr type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->expectExceptionMessage("Failed to write events, got HTTP status code '409', expected '200'"); @@ -121,10 +121,10 @@ public function testRejectsWritingToEmptySubjectWhenUsingTheIsSubjectPopulatedPr $this->client->writeEvents( [ $eventCandidate, - ], + ] [ new IsSubjectPopulated('/test'), - ], + ] ); } @@ -136,7 +136,7 @@ public function testSupportsTheIsSubjectPopulatedPrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $secondEvent = new EventCandidate( @@ -145,7 +145,7 @@ public function testSupportsTheIsSubjectPopulatedPrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->client->writeEvents([ @@ -155,10 +155,10 @@ public function testSupportsTheIsSubjectPopulatedPrecondition(): void $writtenEvents = $this->client->writeEvents( [ $secondEvent, - ], + ] [ new IsSubjectPopulated('/test'), - ], + ] ); $this->assertCount(1, $writtenEvents); @@ -175,7 +175,7 @@ public function testSupportsTheIsSubjectOnEventIdPrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $this->client->writeEvents([ @@ -188,17 +188,17 @@ public function testSupportsTheIsSubjectOnEventIdPrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->expectExceptionMessage("Failed to write events, got HTTP status code '409', expected '200'"); $this->client->writeEvents( [ $secondEvent, - ], + ] [ new IsSubjectOnEventId('/test', '1'), - ], + ] ); } @@ -210,7 +210,7 @@ public function testSupportsTheIsEventQlQueryTruePrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 23, - ], + ] ); $this->client->writeEvents([ @@ -223,17 +223,17 @@ public function testSupportsTheIsEventQlQueryTruePrecondition(): void type: 'io.eventsourcingdb.test', data: [ 'value' => 42, - ], + ] ); $this->expectExceptionMessage("Failed to write events, got HTTP status code '409', expected '200'"); $this->client->writeEvents( [ $secondEvent, - ], + ] [ new IsEventQlQueryTrue('FROM e IN events PROJECT INTO COUNT() == 0'), - ], + ] ); } }