Skip to content

Commit 60b9f57

Browse files
minor change for testing value
1 parent 42f5c02 commit 60b9f57

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/StructuresTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class StructuresTest extends TestCase
5252
{
5353
public function testInit(): AProtocol
5454
{
55-
Bolt::$debug = true;
56-
5755
try {
5856
$conn = new \Bolt\connection\Socket($GLOBALS['NEO_HOST'] ?? '127.0.0.1', $GLOBALS['NEO_PORT'] ?? 7687, 3);
5957
$this->assertInstanceOf(\Bolt\connection\Socket::class, $conn);
@@ -78,20 +76,22 @@ public function testInit(): AProtocol
7876
public function testDate(AProtocol $protocol)
7977
{
8078
try {
79+
$date = date('Y-m-d');
80+
8181
//unpack
8282
$protocol->run('RETURN date($date)', [
83-
'date' => date('Y-m-d')
83+
'date' => $date
8484
]);
8585
$rows = $protocol->pull();
8686
$this->assertInstanceOf(Date::class, $rows[0][0]);
87-
$this->assertEquals(date('Y-m-d'), (string)$rows[0][0]);
87+
$this->assertEquals($date, (string)$rows[0][0]);
8888

8989
//pack
9090
$protocol->run('RETURN toString($date)', [
9191
'date' => $rows[0][0]
9292
]);
9393
$rows = $protocol->pull();
94-
$this->assertEquals(date('Y-m-d'), $rows[0][0]);
94+
$this->assertEquals($date, $rows[0][0]);
9595
} catch (Exception $e) {
9696
$this->markTestIncomplete($e->getMessage());
9797
}
@@ -220,8 +220,8 @@ public function testLocalDateTime(AProtocol $protocol)
220220
public function testLocalTime(AProtocol $protocol)
221221
{
222222
try {
223-
$dt = new \DateTime('now', new \DateTimeZone('UTC'));
224-
$time = $dt->format('H:i:s.u');
223+
$time = \DateTime::createFromFormat('U.u', bcadd(time(), 0.123456, 6))
224+
->format('H:i:s.u');
225225

226226
//unpack
227227
$protocol->run('RETURN localtime($t)', [

0 commit comments

Comments
 (0)