feat(mock): updates tests

This commit is contained in:
Nuno Maduro
2021-05-15 01:01:46 +01:00
parent 99d6fb9f5f
commit 7023cec432
3 changed files with 14 additions and 7 deletions

View File

@ -10,15 +10,15 @@ interface Http
it('can mock methods', function () {
$mock = mock(Http::class)->expect(
get: 'foo',
get: fn () => 'foo',
);
expect($mock->get())->toBe('foo');
})->skip(((float) phpversion()) < 8.0);
test('access to the mock object', function () {
it('allows access to the underlying mockery mock', function () {
$mock = mock(Http::class);
expect($mock->expect())->toBeInstanceOf(MockInterface::class);
expect($mock->expect())->toBeInstanceOf(MockInterface::class);
expect($mock->shouldReceive())->toBeInstanceOf(CompositeExpectation::class);
})->skip(((float) phpversion()) < 8.0);