mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
fix: removes both toHaveMethod and toHaveMethods
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
$object = new class
|
||||
{
|
||||
public function foo(): void {}
|
||||
|
||||
public function bar(): void {}
|
||||
};
|
||||
|
||||
test('pass', function () use ($object) {
|
||||
expect($object)->toHaveMethods(['foo', 'bar']);
|
||||
});
|
||||
|
||||
test('failures', function () use ($object) {
|
||||
expect($object)->toHaveMethods(['foo', 'bar', 'baz']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with custom message', function () use ($object) {
|
||||
expect($object)->toHaveMethods(['foo', 'bar', 'baz'], 'oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () use ($object) {
|
||||
expect($object)->not->toHaveMethods(['foo', 'bar']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
@ -31,14 +31,6 @@ it('can defer a method until after test setup')
|
||||
->toBe('foo')
|
||||
->and('hello world')->toBeString();
|
||||
|
||||
it('can tap a method until after test setup')
|
||||
->expect('foo')->toBeString()
|
||||
->tap(function () {
|
||||
expect($this)->toBeInstanceOf(TestCase::class);
|
||||
})
|
||||
->toBe('foo')
|
||||
->and('hello world')->toBeString();
|
||||
|
||||
it('can pass datasets into the expect callables')
|
||||
->with([[1, 2, 3]])
|
||||
->expect(function (...$numbers) {
|
||||
@ -54,12 +46,6 @@ it('can pass datasets into the defer callable')
|
||||
expect($numbers)->toBe([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('can pass datasets into the tap callable')
|
||||
->with([[1, 2, 3]])
|
||||
->tap(function (...$numbers) {
|
||||
expect($numbers)->toBe([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('can pass shared datasets into callables')
|
||||
->with('numbers.closure.wrapped')
|
||||
->expect(function ($value) {
|
||||
|
||||
Reference in New Issue
Block a user