|
16 | 16 | use Generator;
|
17 | 17 | use InvalidArgumentException;
|
18 | 18 | use IteratorAggregate;
|
| 19 | +use Laudis\Neo4j\Exception\RuntimeTypeException; |
19 | 20 | use function json_encode;
|
20 | 21 | use const JSON_THROW_ON_ERROR;
|
21 | 22 | use Laudis\Neo4j\Databags\Pair;
|
@@ -141,14 +142,14 @@ public function testFilterBlock(): void
|
141 | 142 |
|
142 | 143 | public function testFilterSelective(): void
|
143 | 144 | {
|
144 |
| - $filter = $this->map->filter(static fn (string $i, string $x) => !($i === 'B' || $x === 'z')); |
| 145 | + $filter = $this->map->filter(static fn (string $x, string $i) => !($i === 'B' || $x === 'z')); |
145 | 146 |
|
146 | 147 | self::assertEquals(new CypherMap(['A' => 'x']), $filter);
|
147 | 148 | }
|
148 | 149 |
|
149 | 150 | public function testMap(): void
|
150 | 151 | {
|
151 |
| - $filter = $this->map->map(static fn (string $i, string $x) => $i.':'.$x); |
| 152 | + $filter = $this->map->map(static fn (string $x, string $i) => $i.':'.$x); |
152 | 153 |
|
153 | 154 | self::assertEquals(new CypherMap(['A' => 'A:x', 'B' => 'B:y', 'C' => 'C:z']), $filter);
|
154 | 155 | }
|
@@ -456,5 +457,13 @@ public function testKSortedCustom(): void
|
456 | 457 | self::assertEquals(new CypherMap(['A' => 'x', 'B' => 'y', 'C' => 'z']), $this->map);
|
457 | 458 | }
|
458 | 459 |
|
459 |
| - //test sorted and ksorted |
| 460 | + public function testCasts(): void |
| 461 | + { |
| 462 | + $map = new CypherMap(['a' => null]); |
| 463 | + |
| 464 | + self::assertEquals('', $map->getAsString('a')); |
| 465 | + |
| 466 | + $this->expectException(RuntimeTypeException::class); |
| 467 | + $map->getAsCartesian3DPoint('a'); |
| 468 | + } |
460 | 469 | }
|
0 commit comments