Skip to content

Commit

Permalink
Changes Test code so it's compatible with PHP versions before 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
liambaloh committed Sep 24, 2021
1 parent 4e5cf55 commit 43ce8d4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/MapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,8 @@ public function testHasPath()
public function testIfBlankElse()
{
Map::from( ['a' => 1, 'b' => 0] )->if(
fn(Map $map) => $map->has('c'),
function(Map $_) { $this->assertTrue(false); }
function(Map $map) { return $map->has( 'c' ); },
function(Map $_) { $this->assertTrue( false ); }
);
$this->assertTrue(true);
}
Expand All @@ -1154,19 +1154,19 @@ function(Map $_) { $this->assertTrue(false); }
public function testIfElse()
{
Map::from( ['a' => 1, 'b' => 0] )->if(
fn(Map $map) => $map->has('c'),
function(Map $_) { $this->assertTrue(false); },
function(Map $_) { $this->assertTrue(true);}
function(Map $map) { return $map->has( 'c' ); },
function(Map $_) { $this->assertTrue( false ); },
function(Map $_) { $this->assertTrue( true );}
);
}


public function testIfThen()
{
Map::from( ['a' => 1, 'b' => 0] )->if(
fn(Map $map) => $map->has('a'),
function(Map $_) { $this->assertTrue(true); },
function(Map $_) { $this->assertTrue(false);}
function(Map $map) { return $map->has( 'a' ); },
function(Map $_) { $this->assertTrue( true ); },
function(Map $_) { $this->assertTrue( false );}
);
}

Expand Down

0 comments on commit 43ce8d4

Please sign in to comment.