mirror of
https://github.com/pestphp/pest.git
synced 2026-04-26 08:57:26 +02:00
feat(mock-plugin): moves mock stuff to their own plugin
This commit is contained in:
@ -77,10 +77,6 @@
|
||||
✓ it can call chained macro method
|
||||
✓ it will throw exception from call if no macro exists
|
||||
|
||||
PASS Tests\Features\Mocks
|
||||
✓ it can mock methods
|
||||
✓ it allows access to the underlying mockery mock
|
||||
|
||||
PASS Tests\Features\PendingHigherOrderTests
|
||||
✓ get 'foo' → get 'bar' → expect true → toBeTrue
|
||||
✓ get 'foo' → expect true → toBeTrue
|
||||
@ -223,5 +219,5 @@
|
||||
✓ it is a test
|
||||
✓ it uses correct parent class
|
||||
|
||||
Tests: 7 skipped, 121 passed
|
||||
Tests: 7 skipped, 119 passed
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Mockery\CompositeExpectation;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
interface Http
|
||||
{
|
||||
public function get(): string;
|
||||
}
|
||||
|
||||
it('can mock methods', function () {
|
||||
$mock = mock(Http::class)->expect(
|
||||
get: fn () => 'foo',
|
||||
);
|
||||
|
||||
expect($mock->get())->toBe('foo');
|
||||
})->skip(((float) phpversion()) < 8.0);
|
||||
|
||||
it('can access to arguments', function () {
|
||||
$mock = mock(Http::class)->expect(
|
||||
get: fn ($foo) => $foo,
|
||||
);
|
||||
|
||||
expect($mock->get('foo'))->toBe('foo');
|
||||
})->skip(((float) phpversion()) < 8.0);
|
||||
|
||||
it('allows access to the underlying mockery mock', function () {
|
||||
$mock = mock(Http::class);
|
||||
|
||||
expect($mock->expect())->toBeInstanceOf(MockInterface::class);
|
||||
expect($mock->shouldReceive())->toBeInstanceOf(CompositeExpectation::class);
|
||||
})->skip(((float) phpversion()) < 8.0);
|
||||
Reference in New Issue
Block a user