Skip to content

Commit 952d1fc

Browse files
committed
Fixed tests for PHP 7.x
1 parent eb4b431 commit 952d1fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/MapTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,9 @@ public function testDuplicatesPath()
736736
public function testDuplicatesClosure()
737737
{
738738
$m = new Map( [['i' => ['p' => '1']], ['i' => ['p' => 1]]] );
739-
$r = $m->duplicates( fn( $item, $key ) => $item['i']['p'] );
739+
$r = $m->duplicates( function( $item, $key ) {
740+
return $item['i']['p'];
741+
} );
740742

741743
$this->assertInstanceOf( Map::class, $r );
742744
$this->assertSame( [1 => ['i' => ['p' => 1]]], $r->toArray() );
@@ -3801,7 +3803,9 @@ public function testUniquePath()
38013803
public function testUniqueClosure()
38023804
{
38033805
$m = new Map( [['i' => ['p' => '1']], ['i' => ['p' => 1]]] );
3804-
$r = $m->unique( fn( $item, $key ) => $item['i']['p'] );
3806+
$r = $m->unique( function( $item, $key ) {
3807+
return $item['i']['p'];
3808+
} );
38053809

38063810
$this->assertInstanceOf( Map::class, $r );
38073811
$this->assertSame( [0 => ['i' => ['p' => '1']]], $r->toArray() );

0 commit comments

Comments
 (0)