Skip to content

Commit fe4999d

Browse files
committed
more flexible error response tests
1 parent d2de919 commit fe4999d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Integration/ComplexQueryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function testDiscardAfterTimeout(): void
253253
->first()
254254
->get('x');
255255
} catch (Neo4jException $e) {
256-
self::assertEquals('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
256+
self::assertContains('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
257257
}
258258
}
259259

@@ -265,7 +265,7 @@ public function testTimeoutNoReturn(): void
265265
try {
266266
unset($result);
267267
} catch (Neo4jException $e) {
268-
$this->assertEquals('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
268+
$this->assertContains('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
269269
}
270270
}
271271

@@ -275,7 +275,7 @@ public function testTimeout(): void
275275
try {
276276
$tsx->run('UNWIND range(1, 10000) AS x MERGE (:Number {value: x})');
277277
} catch (Neo4jException $e) {
278-
self::assertEquals('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
278+
self::assertContains('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
279279
$tsx = $this->getSession()->beginTransaction([], TransactionConfiguration::default()->withTimeout(20));
280280
self::assertEquals(1, $tsx->run('RETURN 1 AS one')->first()->get('one'));
281281
}
@@ -328,7 +328,7 @@ public function testLongQueryUnmanagedNegative(): void
328328
$tsx = $this->getSession(['bolt', 'neo4j'])->beginTransaction([], TransactionConfiguration::default()->withTimeout(1));
329329
$tsx->run('UNWIND range(1, 10000) AS x MERGE (:Number {value: x})');
330330
} catch (Neo4jException $e) {
331-
self::assertEquals('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
331+
self::assertContains('Neo.ClientError.Transaction.TransactionTimedOut', $e->getNeo4jCode());
332332
}
333333
}
334334

0 commit comments

Comments
 (0)