Skip to content

Commit 59c8ad9

Browse files
committed
added correct domain identifier to transaction run
fixes #49
1 parent 6c3a4ca commit 59c8ad9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Network/Http/HttpSession.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ private function interpretResponse(ResponseInterface $response): array
129129
*/
130130
public function runOverTransaction(TransactionInterface $transaction, iterable $statements): Vector
131131
{
132-
$request = $this->factory->post($this->data, $statements);
132+
$data = $this->data->withEndpoint($transaction->getDomainIdentifier());
133+
$request = $this->factory->post($data, $statements);
133134
$response = $this->client->sendRequest($request);
134135
$data = $this->interpretResponse($response);
135136

tests/Integration/HttpConsistencyTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ public function testConsistencyTransaction(string $alias): void
5858
Statement::create('CREATE (n:aaa) SET n.name="aaa" return n'),
5959
], $alias);
6060

61+
$tsx->run('CREATE (n:ccc) SET n.name="ccc"');
62+
6163
$tsx->commit([Statement::create('CREATE (n:bbb) SET n.name="bbb" return n')]);
6264

6365
$results = $this->client->run('MATCH (n) RETURN n', ['name' => 'bbbb'], $alias);
6466

65-
self::assertEquals(2, $results->count());
67+
self::assertEquals(3, $results->count());
6668
self::assertEquals(['name' => 'aaa'], $results->first()->get('n'));
69+
self::assertEquals(['name' => 'ccc'], $results->get(1)->get('n'));
6770
self::assertEquals(['name' => 'bbb'], $results->last()->get('n'));
6871
}
6972

0 commit comments

Comments
 (0)