Skip to content

Commit 545fdcf

Browse files
committed
fixed testkit-backend id in response
1 parent e938902 commit 545fdcf

File tree

5 files changed

+61
-22
lines changed

5 files changed

+61
-22
lines changed

.github/workflows/testkit.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Testkit Tests
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
env:
13+
NEO4J_CONNECTIONS: bolt://neo4j:test@localhost,http://neo4j:test@localhost
14+
name: "Running Integration tests for PHP 7.4 on Neo4j ${{ matrix.neo4j-version }} with simple config"
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"]
19+
php-version: ["7.4", "8.0", "8.1"]
20+
21+
services:
22+
neo4j:
23+
image: neo4j:${{ matrix.neo4j-version }}
24+
env:
25+
NEO4J_AUTH: neo4j/test
26+
NEO4JLABS_PLUGINS: '["apoc"]'
27+
ports:
28+
- 7687:7687
29+
- 7474:7474
30+
options: >-
31+
--health-cmd "wget http://localhost:7474 || exit 1"
32+
testkit-backend:
33+
image: php:${{ matrix.neo4j-version }}
34+
env:
35+
NEO4J_AUTH: neo4j/test
36+
NEO4JLABS_PLUGINS: '["apoc"]'
37+
ports:
38+
- 7687:7687
39+
- 7474:7474
40+
options: >-
41+
--health-cmd "wget http://localhost:7474 || exit 1"
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: php-actions/composer@v6
46+
with:
47+
progress: yes
48+
php_version: 7.4
49+
version: 2
50+
- uses: php-actions/phpunit@v3
51+
with:
52+
configuration: phpunit.xml.dist
53+
php_version: 7.4
54+
php_extensions: bcmath
55+
bootstrap: vendor/autoload.php
56+
args: --testsuite "Integration"

testkit-backend/src/Handlers/NewDriver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Laudis\Neo4j\TestkitBackend\Requests\NewDriverRequest;
2424
use Laudis\Neo4j\TestkitBackend\Responses\DriverResponse;
2525
use Symfony\Component\Uid\Uuid;
26+
use function var_export;
2627

2728
/**
2829
* @implements RequestHandlerInterface<NewDriverRequest>
@@ -55,6 +56,7 @@ public function handle($request): DriverResponse
5556
$formatter = SummarizedResultFormatter::create();
5657
$authenticate = Authenticate::basic($user, $pass);
5758
$driver = DriverFactory::create($request->getUri(), $config, $authenticate, $timeout, $formatter);
59+
5860
$id = Uuid::v4();
5961
$this->repository->addDriver($id, $driver);
6062

testkit-backend/src/Handlers/RetryablePositive.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use Laudis\Neo4j\TestkitBackend\Contracts\RequestHandlerInterface;
1717
use Laudis\Neo4j\TestkitBackend\Contracts\TestkitResponseInterface;
18-
use Laudis\Neo4j\TestkitBackend\MainRepository;
1918
use Laudis\Neo4j\TestkitBackend\Requests\RetryablePositiveRequest;
2019
use Laudis\Neo4j\TestkitBackend\Responses\RetryableDoneResponse;
2120

@@ -24,20 +23,11 @@
2423
*/
2524
final class RetryablePositive implements RequestHandlerInterface
2625
{
27-
private MainRepository $repository;
28-
29-
public function __construct(MainRepository $repository)
30-
{
31-
$this->repository = $repository;
32-
}
33-
3426
/**
3527
* @param RetryablePositiveRequest $request
3628
*/
3729
public function handle($request): TestkitResponseInterface
3830
{
39-
$id = $this->repository->getTsxIdFromSession($request->getSessionId());
40-
41-
return new RetryableDoneResponse($id);
31+
return new RetryableDoneResponse();
4232
}
4333
}

testkit-backend/src/Responses/RetryableDoneResponse.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,11 @@
2121
*/
2222
final class RetryableDoneResponse implements TestkitResponseInterface
2323
{
24-
private Uuid $id;
25-
26-
public function __construct(Uuid $id)
27-
{
28-
$this->id = $id;
29-
}
30-
3124
public function jsonSerialize(): array
3225
{
3326
return [
3427
'name' => 'RetryableDone',
35-
'data' => [
36-
'id' => $this->id->toRfc4122(),
37-
],
28+
'data' => [],
3829
];
3930
}
4031
}

testkit-backend/testkit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export TEST_NEO4J_HOST=neo4j
3+
export TEST_NEO4J_HOST=localhost
44
export TEST_NEO4J_USER=neo4j
55
export TEST_NEO4J_PASS=test
66
export TEST_DRIVER_NAME=php

0 commit comments

Comments
 (0)