Skip to content

Commit

Permalink
feat: add assert array has keys
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Feb 27, 2019
1 parent bd63286 commit 21c394a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Asserts.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ public function assertFloatEquals(float $expected, float $actual, int $precision

$this->assertEquals($expected, $actual, $message, \pow(10, 0 - \abs($precision)));
}

public function assertArrayHasKeys(array $expectedKeys, array $actualArray, string $message = null)
{
foreach ($expectedKeys as $key) {
$this->assertArrayHasKey($key, $actualArray, $message);
}
}
}

0 comments on commit 21c394a

Please sign in to comment.