Adds nested Higher Order Expectations.

This commit is contained in:
luke
2021-06-16 20:48:23 +01:00
parent 729638a3bb
commit 7ff64540a6
8 changed files with 128 additions and 53 deletions

View File

@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Pest\Concerns;
use BadMethodCallException;
use Closure;
use Pest\HigherOrderExpectation;
/**
* @internal
@ -43,7 +43,7 @@ trait Extendable
public function __call(string $method, array $parameters)
{
if (!static::hasExtend($method)) {
return new HigherOrderExpectation($this, $method, $parameters);
throw new BadMethodCallException("$method is not a callable method name.");
}
/** @var Closure $extend */