Skip to content

Commit 56f7d92

Browse files
minor changes
1 parent d7d5b99 commit 56f7d92

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cert/
55
/vendor/
66
*.lock
77
*.cache
8-
phpunit.dev.xml
8+
phpunit.dev.xml

tests/PackStream/v1/generators/DictionaryGenerator.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
*
88
* @author Michal Stefanak
99
* @link https://github.com/neo4j-php/Bolt
10-
*
11-
* @covers \Bolt\PackStream\v1\Packer
12-
*
1310
* @package Bolt\tests\PackStream\v1\generators
1411
*/
1512
class DictionaryGenerator implements \Bolt\PackStream\IPackDictionaryGenerator

tests/PackStream/v1/generators/ListGenerator.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
*
88
* @author Michal Stefanak
99
* @link https://github.com/neo4j-php/Bolt
10-
*
11-
* @covers \Bolt\PackStream\v1\Packer
12-
*
1310
* @package Bolt\tests\PackStream\v1\generators
1411
*/
1512
class ListGenerator implements \Bolt\PackStream\IPackListGenerator

tests/PackStream/v1/generators/RandomDataGenerator.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
namespace Bolt\tests\PackStream\v1\generators;
44

55
use Bolt\PackStream\IPackListGenerator;
6-
use function bin2hex;
7-
use function hex2bin;
8-
use function random_bytes;
96

7+
/**
8+
* Class ListGenerator
9+
* @author Ghlen Nagels
10+
* @link https://github.com/neo4j-php/Bolt
11+
* @package Bolt\tests\PackStream\v1\generators
12+
*/
1013
class RandomDataGenerator implements IPackListGenerator
1114
{
1215
private int $rows;
@@ -46,4 +49,4 @@ public function count(): int
4649
{
4750
return $this->rows;
4851
}
49-
}
52+
}

tests/PerformanceTest.php

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,35 @@
88
use Bolt\tests\PackStream\v1\generators\RandomDataGenerator;
99
use PHPUnit\Framework\TestCase;
1010

11+
/**
12+
* Class PerformanceTest
13+
* @author Ghlen Nagels
14+
* @link https://github.com/neo4j-php/Bolt
15+
* @package Bolt\tests
16+
*/
1117
class PerformanceTest extends TestCase
1218
{
1319
public function test50KRecords(): void
1420
{
1521
$amount = 50000;
1622

17-
$conn = new StreamSocket($GLOBALS['NEO_HOST'] ?? 'localhost', $GLOBALS['NEO_PORT'] ?? 7687);
18-
$protocol = (new Bolt($conn))->build();
19-
$this->assertNotEmpty($protocol->init(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS'])));
23+
try {
24+
$conn = new StreamSocket($GLOBALS['NEO_HOST'] ?? 'localhost', $GLOBALS['NEO_PORT'] ?? 7687);
25+
$protocol = (new Bolt($conn))->build();
26+
$this->assertNotEmpty($protocol->init(Auth::basic($GLOBALS['NEO_USER'], $GLOBALS['NEO_PASS'])));
2027

21-
$generator = new RandomDataGenerator($amount);
22-
$protocol->run('UNWIND $x as x RETURN x', ['x' => $generator]);
28+
$generator = new RandomDataGenerator($amount);
29+
$protocol->run('UNWIND $x as x RETURN x', ['x' => $generator]);
2330

24-
$count = 0;
25-
while ($count < $amount) {
26-
++$count;
27-
$protocol->pull(['n' => 1]);
28-
}
31+
$count = 0;
32+
while ($count < $amount) {
33+
++$count;
34+
$protocol->pullAll(['n' => 1]);
35+
}
2936

30-
$this->assertEquals($amount, $count);
37+
$this->assertEquals($amount, $count);
38+
} catch (\Exception $e) {
39+
$this->markTestIncomplete($e->getMessage());
40+
}
3141
}
32-
}
42+
}

0 commit comments

Comments
 (0)