From 8494d4566a880d0bef850667215666e0cf2d42e5 Mon Sep 17 00:00:00 2001 From: Fabio Ivona Date: Fri, 26 Nov 2021 16:15:36 +0100 Subject: [PATCH] fix tests --- src/Concerns/Extendable.php | 6 ++++-- .../ExpectationNotFoundException.php | 18 ------------------ 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 src/Exceptions/ExpectationNotFoundException.php diff --git a/src/Concerns/Extendable.php b/src/Concerns/Extendable.php index 1a8dc379..6f83693a 100644 --- a/src/Concerns/Extendable.php +++ b/src/Concerns/Extendable.php @@ -39,7 +39,9 @@ trait Extendable } /** - * Recister an interceptor that should replace an existing expectation. + * Register an interceptor that should replace an existing expectation. + * + * @param string|Closure(mixed $value, mixed ...$arguments):bool $filter */ public static function intercept(string $name, string|Closure $filter, Closure $handler): void { @@ -51,7 +53,7 @@ trait Extendable self::pipe($name, function ($next, ...$arguments) use ($handler, $filter) { /* @phpstan-ignore-next-line */ - if ($filter($this->value)) { + if ($filter($this->value, ...$arguments)) { //@phpstan-ignore-next-line $handler->bindTo($this, get_class($this))(...$arguments); diff --git a/src/Exceptions/ExpectationNotFoundException.php b/src/Exceptions/ExpectationNotFoundException.php deleted file mode 100644 index 07bafdc3..00000000 --- a/src/Exceptions/ExpectationNotFoundException.php +++ /dev/null @@ -1,18 +0,0 @@ -