@@ -105,7 +105,7 @@ public static function assertMatchesJsonSchema(object|array|string $jsonSchema,
105
105
static ::assertThat (self ::getHttpResponse ()->toArray (false ), $ constraint , $ message );
106
106
}
107
107
108
- public static function assertMatchesResourceCollectionJsonSchema (string $ resourceClass , ?string $ operationName = null , string $ format = 'jsonld ' ): void
108
+ public static function assertMatchesResourceCollectionJsonSchema (string $ resourceClass , ?string $ operationName = null , string $ format = 'jsonld ' , ? array $ serializationContext = null ): void
109
109
{
110
110
$ schemaFactory = self ::getSchemaFactory ();
111
111
@@ -115,12 +115,12 @@ public static function assertMatchesResourceCollectionJsonSchema(string $resourc
115
115
$ operation = $ operationName ? (new GetCollection ())->withName ($ operationName ) : new GetCollection ();
116
116
}
117
117
118
- $ schema = $ schemaFactory ->buildSchema ($ resourceClass , $ format , Schema::TYPE_OUTPUT , $ operation , null );
118
+ $ schema = $ schemaFactory ->buildSchema ($ resourceClass , $ format , Schema::TYPE_OUTPUT , $ operation , null , $ serializationContext );
119
119
120
120
static ::assertMatchesJsonSchema ($ schema ->getArrayCopy ());
121
121
}
122
122
123
- public static function assertMatchesResourceItemJsonSchema (string $ resourceClass , ?string $ operationName = null , string $ format = 'jsonld ' ): void
123
+ public static function assertMatchesResourceItemJsonSchema (string $ resourceClass , ?string $ operationName = null , string $ format = 'jsonld ' , ? array $ serializationContext = null ): void
124
124
{
125
125
$ schemaFactory = self ::getSchemaFactory ();
126
126
@@ -130,7 +130,7 @@ public static function assertMatchesResourceItemJsonSchema(string $resourceClass
130
130
$ operation = $ operationName ? (new Get ())->withName ($ operationName ) : new Get ();
131
131
}
132
132
133
- $ schema = $ schemaFactory ->buildSchema ($ resourceClass , $ format , Schema::TYPE_OUTPUT , $ operation , null );
133
+ $ schema = $ schemaFactory ->buildSchema ($ resourceClass , $ format , Schema::TYPE_OUTPUT , $ operation , null , $ serializationContext );
134
134
135
135
static ::assertMatchesJsonSchema ($ schema ->getArrayCopy ());
136
136
}
0 commit comments