fix: removes both toHaveMethod and toHaveMethods

This commit is contained in:
Nuno Maduro
2024-08-28 16:30:29 -05:00
parent ecdbe7a472
commit 5ae5ac9a54
11 changed files with 106 additions and 120 deletions

View File

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