mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
25 lines
576 B
PHP
25 lines
576 B
PHP
<?php
|
|
|
|
use Mockery\CompositeExpectation;
|
|
use Mockery\MockInterface;
|
|
|
|
interface Http
|
|
{
|
|
public function get(): string;
|
|
}
|
|
|
|
it('can mock methods', function () {
|
|
$mock = mock(Http::class)->expect(
|
|
get: 'foo',
|
|
);
|
|
|
|
expect($mock->get())->toBe('foo');
|
|
})->skip(((float) phpversion()) < 8.0);
|
|
|
|
test('access to the mock object', function () {
|
|
$mock = mock(Http::class);
|
|
expect($mock->expect())->toBeInstanceOf(MockInterface::class);
|
|
|
|
expect($mock->shouldReceive())->toBeInstanceOf(CompositeExpectation::class);
|
|
})->skip(((float) phpversion()) < 8.0);
|