Skip to content

Commit 3681528

Browse files
Merge pull request #106 from neo4j-php/neo4j-v52
update to latest neo4j version 5.2
2 parents 5b5c7e4 + 468189d commit 3681528

File tree

14 files changed

+77
-95
lines changed

14 files changed

+77
-95
lines changed

.github/workflows/db-test-php-7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
neo4j-version: ["4.3", "4.4", "5", "5.1.0"]
16+
neo4j-version: ["4.3", "4.4", "5.1", "5.2"]
1717
php-version: ['7.4']
1818

1919
services:

.github/workflows/db-test-php-8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
neo4j-version: ["4.3", "4.4", "5", "5.1.0"]
16+
neo4j-version: ["4.3", "4.4", "5.1", "5.2"]
1717
php-version: ['8.0', '8.1']
1818

1919
services:

src/Bolt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Bolt
3434
public function __construct(IConnection $connection)
3535
{
3636
$this->connection = $connection;
37-
$this->setProtocolVersions(5.1, 5.0, 4.4, 4.3);
37+
$this->setProtocolVersions(5, 4.4, 4.3);
3838
$this->setPackStreamVersion();
3939
}
4040

src/protocol/V5_1.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/BoltTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
namespace Bolt\tests;
44

55
use Bolt\Bolt;
6-
use Bolt\protocol\AProtocol;
76
use Exception;
87
use PHPUnit\Framework\TestCase;
9-
use Bolt\protocol\{Response, V4_3, V4_4};
8+
use Bolt\protocol\{
9+
AProtocol,
10+
Response,
11+
V4_3,
12+
V4_4,
13+
V5
14+
};
1015

1116
/**
1217
* Class BoltTest
@@ -24,6 +29,7 @@
2429
* @covers \Bolt\protocol\AProtocol
2530
* @covers \Bolt\protocol\V4_3
2631
* @covers \Bolt\protocol\V4_4
32+
* @covers \Bolt\protocol\V5
2733
* @covers \Bolt\protocol\Response
2834
* @covers \Bolt\protocol\ServerState
2935
*
@@ -43,7 +49,7 @@ public function testSockets()
4349
$bolt = new Bolt($conn);
4450
$this->assertInstanceOf(Bolt::class, $bolt);
4551

46-
/** @var V4_3|V4_4 $protocol */
52+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
4753
$protocol = $bolt->build();
4854
$this->assertInstanceOf(AProtocol::class, $protocol);
4955

@@ -63,7 +69,7 @@ public function testAura()
6369
$bolt = new Bolt($conn);
6470
$this->assertInstanceOf(Bolt::class, $bolt);
6571

66-
/** @var V4_3|V4_4 $protocol */
72+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
6773
$protocol = $bolt->build();
6874
$this->assertInstanceOf(AProtocol::class, $protocol);
6975

@@ -83,7 +89,7 @@ public function testHello(): AProtocol
8389
$bolt = new Bolt($conn);
8490
$this->assertInstanceOf(Bolt::class, $bolt);
8591

86-
/** @var V4_3|V4_4 $protocol */
92+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
8793
$protocol = $bolt->build();
8894
$this->assertInstanceOf(AProtocol::class, $protocol);
8995

tests/PerformanceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Bolt\Bolt;
66
use Bolt\connection\StreamSocket;
77
use Bolt\helpers\Auth;
8+
use Bolt\protocol\{AProtocol, V4_3, V4_4, V5};
89
use Bolt\tests\packstream\v1\generators\RandomDataGenerator;
910
use PHPUnit\Framework\TestCase;
1011

@@ -21,7 +22,7 @@ public function test50KRecords(): void
2122
$amount = 50000;
2223

2324
$conn = new StreamSocket($GLOBALS['NEO_HOST'] ?? 'localhost', $GLOBALS['NEO_PORT'] ?? 7687, 60);
24-
/** @var \Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
25+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
2526
$protocol = (new Bolt($conn))->build();
2627
$this->assertEquals(\Bolt\protocol\Response::SIGNATURE_SUCCESS, $protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']))->getSignature());
2728

tests/connection/ConnectionTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
namespace Bolt\tests\connection;
44

55
use Bolt\Bolt;
6-
use Bolt\protocol\Response;
6+
use Bolt\protocol\{
7+
AProtocol,
8+
Response,
9+
V4_3,
10+
V4_4,
11+
V5
12+
};
713
use Bolt\connection\{
814
IConnection,
915
Socket,
@@ -42,7 +48,7 @@ public function testMillisecondTimeout(string $alias)
4248
{
4349
$conn = $this->getConnection($alias);
4450
$conn->setTimeout(1.5);
45-
/** @var \Bolt\protocol\AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
51+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
4652
$protocol = (new Bolt($conn))->build();
4753
$protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']));
4854
$this->expectException(ConnectionTimeoutException::class);
@@ -59,7 +65,7 @@ public function testMillisecondTimeout(string $alias)
5965
public function testLongNoTimeout(string $alias)
6066
{
6167
$conn = $this->getConnection($alias);
62-
/** @var \Bolt\protocol\AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
68+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
6369
$protocol = (new Bolt($conn))->build();
6470
$protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']));
6571
$conn->setTimeout(200);
@@ -76,7 +82,7 @@ public function testSecondsTimeout(string $alias)
7682
{
7783
$conn = $this->getConnection($alias);
7884
$conn->setTimeout(1);
79-
/** @var \Bolt\protocol\AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
85+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
8086
$protocol = (new Bolt($conn))->build();
8187
$protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']));
8288
$this->expectException(ConnectionTimeoutException::class);
@@ -92,7 +98,7 @@ public function testSecondsTimeout(string $alias)
9298
public function testTimeoutRecoverAndReset(string $alias)
9399
{
94100
$conn = $this->getConnection($alias);
95-
/** @var \Bolt\protocol\AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
101+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
96102
$protocol = (new Bolt($conn))->build();
97103
$protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']));
98104

@@ -117,7 +123,7 @@ public function testTimeoutRecoverAndReset(string $alias)
117123
->getResponse();
118124

119125
$this->assertEquals(Response::SIGNATURE_FAILURE, $response->getSignature());
120-
/** @var \Bolt\protocol\AProtocol|\Bolt\protocol\V4_3|\Bolt\protocol\V4_4 $protocol */
126+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
121127
$protocol = (new Bolt($conn))->build();
122128
$protocol->hello(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS']));
123129

tests/packstream/v1/BytesTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44

55
use Bolt\Bolt;
66
use Bolt\packstream\Bytes;
7-
use Bolt\protocol\AProtocol;
8-
use Bolt\protocol\Response;
7+
use Bolt\protocol\{
8+
AProtocol,
9+
Response,
10+
V4_3,
11+
V4_4,
12+
V5
13+
};
914
use PHPUnit\Framework\TestCase;
1015

1116
/**
@@ -22,6 +27,7 @@ public function testInit(): AProtocol
2227
$bolt = new Bolt($conn);
2328
$this->assertInstanceOf(Bolt::class, $bolt);
2429

30+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
2531
$protocol = $bolt->build();
2632
$this->assertInstanceOf(AProtocol::class, $protocol);
2733

tests/packstream/v1/PackerTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
namespace Bolt\tests\packstream\v1;
44

5-
use Bolt\protocol\AProtocol;
65
use Bolt\Bolt;
7-
use Bolt\protocol\{Response, V4_3, V4_4};
6+
use Bolt\protocol\{
7+
AProtocol,
8+
Response,
9+
V4_3,
10+
V4_4,
11+
V5
12+
};
813
use PHPUnit\Framework\TestCase;
914

1015
/**
@@ -30,7 +35,7 @@ public function testInit(): AProtocol
3035
$bolt = new Bolt($conn);
3136
$this->assertInstanceOf(Bolt::class, $bolt);
3237

33-
/** @var V4_3|V4_4 $protocol */
38+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
3439
$protocol = $bolt->build();
3540
$this->assertInstanceOf(AProtocol::class, $protocol);
3641

tests/packstream/v1/UnpackerTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
namespace Bolt\tests\packstream\v1;
44

55
use Bolt\Bolt;
6-
use Bolt\protocol\AProtocol;
7-
use Bolt\protocol\Response;
8-
use Exception;
6+
use Bolt\protocol\{
7+
AProtocol,
8+
Response,
9+
V4_3,
10+
V4_4,
11+
V5
12+
};
913
use PHPUnit\Framework\TestCase;
1014

1115
/**
@@ -28,6 +32,7 @@ public function testInit(): AProtocol
2832
$bolt = new Bolt($conn);
2933
$this->assertInstanceOf(Bolt::class, $bolt);
3034

35+
/** @var AProtocol|V4_3|V4_4|V5 $protocol */
3136
$protocol = $bolt->build();
3237
$this->assertInstanceOf(AProtocol::class, $protocol);
3338

0 commit comments

Comments
 (0)