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

@ -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);
});