mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
fix tests
This commit is contained in:
@ -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
|
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) {
|
self::pipe($name, function ($next, ...$arguments) use ($handler, $filter) {
|
||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
if ($filter($this->value)) {
|
if ($filter($this->value, ...$arguments)) {
|
||||||
//@phpstan-ignore-next-line
|
//@phpstan-ignore-next-line
|
||||||
$handler->bindTo($this, get_class($this))(...$arguments);
|
$handler->bindTo($this, get_class($this))(...$arguments);
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Pest\Exceptions;
|
|
||||||
|
|
||||||
use InvalidArgumentException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
final class ExpectationNotFoundException extends InvalidArgumentException
|
|
||||||
{
|
|
||||||
public function __construct(string $expectationName)
|
|
||||||
{
|
|
||||||
parent::__construct(sprintf('Impossible to find [%s] expectation', $expectationName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user