Skip to content

Commit 7a31b60

Browse files
committed
fixed tests
1 parent 7264fc4 commit 7a31b60

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/Unit/CypherMapTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Generator;
1717
use InvalidArgumentException;
1818
use IteratorAggregate;
19+
use Laudis\Neo4j\Exception\RuntimeTypeException;
1920
use function json_encode;
2021
use const JSON_THROW_ON_ERROR;
2122
use Laudis\Neo4j\Databags\Pair;
@@ -141,14 +142,14 @@ public function testFilterBlock(): void
141142

142143
public function testFilterSelective(): void
143144
{
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'));
145146

146147
self::assertEquals(new CypherMap(['A' => 'x']), $filter);
147148
}
148149

149150
public function testMap(): void
150151
{
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);
152153

153154
self::assertEquals(new CypherMap(['A' => 'A:x', 'B' => 'B:y', 'C' => 'C:z']), $filter);
154155
}
@@ -456,5 +457,13 @@ public function testKSortedCustom(): void
456457
self::assertEquals(new CypherMap(['A' => 'x', 'B' => 'y', 'C' => 'z']), $this->map);
457458
}
458459

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+
}
460469
}

0 commit comments

Comments
 (0)