feat(expect): adds toHaveProperty

This commit is contained in:
Nuno Maduro
2020-07-14 23:37:02 +02:00
parent 32ef377284
commit 1aec8bac55
6 changed files with 42 additions and 34 deletions

View File

@ -156,6 +156,16 @@ final class Expectation
return $this;
}
/**
* Assert that the $value contains the property $name.
*/
public function toHaveProperty(string $name): Expectation
{
Assert::assertTrue(property_exists($this->value, $name));
return $this;
}
/**
* Asserts that two variables have the same value.
*