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 3131use Laudis \Neo4j \Types \CypherMap ;
3232use Laudis \Neo4j \Types \Date ;
3333use Laudis \Neo4j \Types \DateTime ;
34+ use Laudis \Neo4j \Types \DateTimeZoneId ;
3435use Laudis \Neo4j \Types \Duration ;
3536use Laudis \Neo4j \Types \LocalDateTime ;
3637use Laudis \Neo4j \Types \LocalTime ;
5152 *
5253 * @see https://neo4j.com/docs/driver-manual/current/cypher-workflow/#driver-type-mapping
5354 *
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>
5556 * @psalm-type OGMResults = CypherList<CypherMap<OGMTypes>>
5657 *
5758 * @psalm-import-type BoltMeta from FormatterInterface
Original file line number Diff line number Diff line change 1414namespace Laudis \Neo4j \Tests \Integration ;
1515
1616use function bin2hex ;
17+
18+ use DateTimeImmutable ;
19+
1720use function dump ;
1821
1922use Laudis \Neo4j \Contracts \TransactionInterface ;
2023use Laudis \Neo4j \Databags \SummarizedResult ;
2124use Laudis \Neo4j \Databags \SummaryCounters ;
2225use Laudis \Neo4j \Types \CypherList ;
2326use Laudis \Neo4j \Types \CypherMap ;
27+ use Laudis \Neo4j \Types \DateTimeZoneId ;
2428
2529use function random_bytes ;
2630use function serialize ;
@@ -96,4 +100,13 @@ public function testAvailableAfter(): void
96100
97101 self ::assertGreaterThan (0 , $ results ->getSummary ()->getResultAvailableAfter ());
98102 }
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+ }
99112}
You can’t perform that action at this time.
0 commit comments