Add toHaveProperties

This commit is contained in:
Esteban
2021-09-03 04:26:57 -04:00
parent 60c0636523
commit 4331b2aaf6
2 changed files with 40 additions and 0 deletions

View File

@ -386,6 +386,20 @@ final class Expectation
return $this;
}
/**
* Asserts that the value contains the provided properties $names.
*
* @param array<string> $names
*/
public function toHaveProperties(array $names): Expectation
{
foreach ($names as $name) {
$this->toHaveProperty($name);
}
return $this;
}
/**
* Asserts that two variables have the same value.
*