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:
@ -11,10 +11,10 @@ afterEach(function () use ($state) {
|
||||
});
|
||||
|
||||
it('does not get executed before the test', function () {
|
||||
expect(property_exists($this->state, 'bar'))->toBeFalse();
|
||||
expect($this->state)->not->toHaveProperty('bar');
|
||||
});
|
||||
|
||||
it('gets executed after the test', function () {
|
||||
expect(property_exists($this->state, 'bar'))->toBeTrue();
|
||||
expect($this->state)->toHaveProperty('bar');
|
||||
expect($this->state->bar)->toBe(2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user