Skip to content

Commit

Permalink
Fixed tests for PHP 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Jul 31, 2024
1 parent 4f0de56 commit 8707364
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/MapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public function testAvg()

public function testAvgClosure()
{
$this->assertSame( 20.0, Map::from( [30, 50, 10] )->avg( fn( $val ) => $val < 50 ? $val : null ) );
$this->assertSame( 30.0, Map::from( [30, 50, 10] )->avg( fn( $val, $key ) => $key < 1 ? $val : null ) );
$this->assertSame( 20.0, Map::from( [30, 50, 10] )->avg( function( $val ) { return $val < 50 ? $val : null; } ) );
$this->assertSame( 30.0, Map::from( [30, 50, 10] )->avg( function( $val, $key ) { return $key < 1 ? $val : null; } ) );
}


Expand Down Expand Up @@ -3083,8 +3083,8 @@ public function testSum()

public function testSumClosure()
{
$this->assertSame( 40.0, Map::from( [30, 50, 10] )->sum( fn( $val ) => $val < 50 ? $val : 0 ) );
$this->assertSame( 60.0, Map::from( [30, 50, 10] )->sum( fn( $val, $key ) => $key > 0 ? $val : 0 ) );
$this->assertSame( 40.0, Map::from( [30, 50, 10] )->sum( function( $val ) { return $val < 50 ? $val : 0; } ) );
$this->assertSame( 60.0, Map::from( [30, 50, 10] )->sum( function( $val, $key ) { return $key > 0 ? $val : 0; } ) );
}


Expand Down

0 comments on commit 8707364

Please sign in to comment.