mirror of
https://github.com/pestphp/pest.git
synced 2026-12-06 07:42:17 +01:00
fix: not->toHaveKeys() with nested keys (#2094)
This commit is contained in:
@@ -48,12 +48,14 @@ final readonly class OppositeExpectation
|
||||
public function toHaveKeys(array $keys): Expectation
|
||||
{
|
||||
foreach ($keys as $k => $key) {
|
||||
if (is_array($key)) {
|
||||
$this->toHaveKeys(array_keys(Arr::dot($key, $k.'.')));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
if (is_array($key)) {
|
||||
$this->toHaveKeys(array_keys(Arr::dot($key, $k.'.')));
|
||||
} else {
|
||||
$this->original->toHaveKey($key);
|
||||
}
|
||||
$this->original->toHaveKey($key);
|
||||
} catch (ExpectationFailedException) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user