File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 31
31
use Laudis \Neo4j \Types \CypherMap ;
32
32
use Laudis \Neo4j \Types \Date ;
33
33
use Laudis \Neo4j \Types \DateTime ;
34
+ use Laudis \Neo4j \Types \DateTimeZoneId ;
34
35
use Laudis \Neo4j \Types \Duration ;
35
36
use Laudis \Neo4j \Types \LocalDateTime ;
36
37
use Laudis \Neo4j \Types \LocalTime ;
51
52
*
52
53
* @see https://neo4j.com/docs/driver-manual/current/cypher-workflow/#driver-type-mapping
53
54
*
54
- * @psalm-type OGMTypes = string|int|float|bool|null|Date|DateTime|Duration|LocalDateTime|LocalTime|Time|Node|Relationship|Path|Cartesian3DPoint|CartesianPoint|WGS84Point|WGS843DPoint|CypherList<mixed>|CypherMap<mixed>
55
+ * @psalm-type OGMTypes = string|int|float|bool|null|Date|DateTime|Duration|LocalDateTime|LocalTime|Time|Node|Relationship|Path|Cartesian3DPoint|CartesianPoint|WGS84Point|WGS843DPoint|DateTimeZoneId| CypherList<mixed>|CypherMap<mixed>
55
56
* @psalm-type OGMResults = CypherList<CypherMap<OGMTypes>>
56
57
*
57
58
* @psalm-import-type BoltMeta from FormatterInterface
Original file line number Diff line number Diff line change 14
14
namespace Laudis \Neo4j \Tests \Integration ;
15
15
16
16
use function bin2hex ;
17
+
18
+ use DateTimeImmutable ;
19
+
17
20
use function dump ;
18
21
19
22
use Laudis \Neo4j \Contracts \TransactionInterface ;
20
23
use Laudis \Neo4j \Databags \SummarizedResult ;
21
24
use Laudis \Neo4j \Databags \SummaryCounters ;
22
25
use Laudis \Neo4j \Types \CypherList ;
23
26
use Laudis \Neo4j \Types \CypherMap ;
27
+ use Laudis \Neo4j \Types \DateTimeZoneId ;
24
28
25
29
use function random_bytes ;
26
30
use function serialize ;
@@ -96,4 +100,13 @@ public function testAvailableAfter(): void
96
100
97
101
self ::assertGreaterThan (0 , $ results ->getSummary ()->getResultAvailableAfter ());
98
102
}
103
+
104
+ public function testDateTime (): void
105
+ {
106
+ $ dt = new DateTimeImmutable ();
107
+ $ ls = $ this ->getClient ()->run ('RETURN $x AS x ' , ['x ' => $ dt ])->first ()->get ('x ' );
108
+
109
+ $ this ->assertInstanceOf (DateTimeZoneId::class, $ ls );
110
+ $ this ->assertEquals ($ dt , $ ls ->toDateTime ());
111
+ }
99
112
}
You can’t perform that action at this time.
0 commit comments