From ac7199c96debf53264416ba67988c84ab7699584 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 30 Apr 2024 20:48:25 +0100 Subject: [PATCH] wip --- src/PendingCalls/TestCall.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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. */