@@ -212,17 +212,26 @@ public function testProfileCreateKnowsBidirectionalRelationships(): void
212
212
213
213
$ result = $ this ->api ->run ($ query );
214
214
$ this ->assertNotNull ($ result ->getProfiledQueryPlan (), "profiled query plan not found " );
215
+
215
216
$ body = file_get_contents (__DIR__ . '/../resources/responses/complex-query-profile.json ' );
216
217
217
218
if ($ body === false ) {
218
219
throw new RuntimeException ('Failed to read the file: ' . __DIR__ . '/../resources/responses/complex-query-profile.json ' );
219
220
}
221
+
220
222
$ mockSack = new MockHandler ([
221
223
new Response (200 , [], $ body ),
222
224
]);
223
225
224
226
$ handler = HandlerStack::create ($ mockSack );
225
227
$ client = new Client (['handler ' => $ handler ]);
228
+
229
+ $ neo4jAddress = is_string (getenv ('NEO4J_ADDRESS ' )) ? getenv ('NEO4J_ADDRESS ' ) : '' ;
230
+
231
+ if ($ neo4jAddress === '' ) {
232
+ throw new RuntimeException ('NEO4J_ADDRESS is not set. ' );
233
+ }
234
+
226
235
$ auth = Authentication::fromEnvironment ();
227
236
228
237
$ api = new Neo4jQueryAPI (
@@ -231,12 +240,13 @@ public function testProfileCreateKnowsBidirectionalRelationships(): void
231
240
new Neo4jRequestFactory (
232
241
new Psr17Factory (),
233
242
new Psr17Factory (),
234
- new Configuration (' ABC ' ),
243
+ new Configuration ($ neo4jAddress ),
235
244
$ auth
236
245
)
237
246
);
238
247
239
- $ result = $ api ->run ($ query );
248
+
249
+ $ result = $ api ->run ($ query );
240
250
241
251
$ plan = $ result ->getProfiledQueryPlan ();
242
252
$ this ->assertNotNull ($ plan , "The result of the query should not be null. " );
0 commit comments