diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index 9e7f718f..74a69018 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -8,6 +8,7 @@ use Closure; use Pest\Exceptions\InvalidArgumentException; use Pest\Factories\Attribute; use Pest\Factories\TestCaseMethodFactory; +use Pest\Mutate\Decorators\TestCallDecorator as MutationTestCallDecorator; use Pest\PendingCalls\Concerns\Describable; use Pest\Plugins\Only; use Pest\Support\Backtrace; @@ -448,6 +449,19 @@ final class TestCall return $this; } + /** + * Enables mutation testing + */ + public function mutate(string $profile = 'default'): self|MutationTestCallDecorator + { + if (class_exists(MutationTestCallDecorator::class)) { + return (new MutationTestCallDecorator($this)) + ->mutate($profile); + } + + return $this->__call('mutate', [$profile]); + } + /** * Creates the Call. */