mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat(expect): adds toHaveProperty
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user