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

@ -344,36 +344,6 @@ final class Expectation
return $this;
}
/**
* Asserts that the value has the method $name.
*
* @return self<TValue>
*/
public function toHaveMethod(string $name, string $message = ''): self
{
$this->toBeObject();
// @phpstan-ignore-next-line
Assert::assertTrue(method_exists($this->value, $name), $message);
return $this;
}
/**
* Asserts that the value has the provided methods $names.
*
* @param iterable<array-key, string> $names
* @return self<TValue>
*/
public function toHaveMethods(iterable $names, string $message = ''): self
{
foreach ($names as $name) {
$this->toHaveMethod($name, message: $message);
}
return $this;
}
/**
* Asserts that two variables have the same value.
*