27
27
28
28
final class CypherMapTest extends TestCase
29
29
{
30
+ /** @var CypherMap<string> */
30
31
private CypherMap $ map ;
31
32
32
33
public function setUp (): void
@@ -341,11 +342,11 @@ public function testJoinEmpty(): void
341
342
342
343
public function testDiff (): void
343
344
{
344
- $ subtract = new CypherMap (['B ' => null , 'Z ' => 'z ' ]);
345
+ $ subtract = new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]);
345
346
$ result = $ this ->map ->diff ($ subtract );
346
347
347
348
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'C ' => 'z ' ]), $ result );
348
- self ::assertEquals (new CypherMap (['B ' => null , 'Z ' => 'z ' ]), $ subtract );
349
+ self ::assertEquals (new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]), $ subtract );
349
350
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
350
351
}
351
352
@@ -356,31 +357,31 @@ public function testDiffEmpty(): void
356
357
357
358
public function testIntersect (): void
358
359
{
359
- $ intersect = new CypherMap (['B ' => null , 'Z ' => 'z ' ]);
360
+ $ intersect = new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]);
360
361
$ result = $ this ->map ->intersect ($ intersect );
361
362
362
363
self ::assertEquals (new CypherMap (['B ' => 'y ' ]), $ result );
363
- self ::assertEquals (new CypherMap (['B ' => null , 'Z ' => 'z ' ]), $ intersect );
364
+ self ::assertEquals (new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]), $ intersect );
364
365
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
365
366
}
366
367
367
368
public function testUnion (): void
368
369
{
369
- $ intersect = new CypherMap (['B ' => null , 'Z ' => 'z ' ]);
370
+ $ intersect = new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]);
370
371
$ result = $ this ->map ->union ($ intersect );
371
372
372
373
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' , 'Z ' => 'z ' ]), $ result );
373
- self ::assertEquals (new CypherMap (['B ' => null , 'Z ' => 'z ' ]), $ intersect );
374
+ self ::assertEquals (new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]), $ intersect );
374
375
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
375
376
}
376
377
377
378
public function testXor (): void
378
379
{
379
- $ intersect = new CypherMap (['B ' => null , 'Z ' => 'z ' ]);
380
+ $ intersect = new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]);
380
381
$ result = $ this ->map ->xor ($ intersect );
381
382
382
383
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'C ' => 'z ' , 'Z ' => 'z ' ]), $ result );
383
- self ::assertEquals (new CypherMap (['B ' => null , 'Z ' => 'z ' ]), $ intersect );
384
+ self ::assertEquals (new CypherMap (['B ' => ' x ' , 'Z ' => 'z ' ]), $ intersect );
384
385
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
385
386
}
386
387
@@ -435,7 +436,7 @@ public function testSortedDefault(): void
435
436
436
437
public function testSortedCustom (): void
437
438
{
438
- $ sorted = $ this ->map ->sorted (static fn (string $ x , $ y ) => -1 * ($ x <=> $ y ));
439
+ $ sorted = $ this ->map ->sorted (static fn (string $ x , string $ y ): int => -1 * ($ x <=> $ y ));
439
440
440
441
self ::assertEquals (new CypherMap (['C ' => 'z ' , 'B ' => 'y ' , 'A ' => 'x ' ]), $ sorted );
441
442
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
@@ -449,7 +450,7 @@ public function testKSorted(): void
449
450
450
451
public function testKSortedCustom (): void
451
452
{
452
- $ sorted = $ this ->map ->ksorted (static fn (string $ x , $ y ) => -1 * ($ x <=> $ y ));
453
+ $ sorted = $ this ->map ->ksorted (static fn (string $ x , string $ y ) => -1 * ($ x <=> $ y ));
453
454
454
455
self ::assertEquals (new CypherMap (['C ' => 'z ' , 'B ' => 'y ' , 'A ' => 'x ' ]), $ sorted );
455
456
self ::assertEquals (new CypherMap (['A ' => 'x ' , 'B ' => 'y ' , 'C ' => 'z ' ]), $ this ->map );
0 commit comments