From 27baad82d03fbe397d7a7a94d132e7506ba52fa2 Mon Sep 17 00:00:00 2001 From: danilopolani Date: Sat, 5 Mar 2022 17:03:45 +0100 Subject: [PATCH] remove method name on coversClass --- src/Factories/Attributes/Covers.php | 4 ---- src/Factories/Covers/CoversClass.php | 2 +- src/PendingCalls/TestCall.php | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Factories/Attributes/Covers.php b/src/Factories/Attributes/Covers.php index a965ca21..136dd432 100644 --- a/src/Factories/Attributes/Covers.php +++ b/src/Factories/Attributes/Covers.php @@ -26,10 +26,6 @@ final class Covers foreach ($method->covers as $covering) { if ($covering instanceof CoversClass) { $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversClass({$covering->class}]"; - - if (!is_null($covering->method)) { - $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversFunction('{$covering->method}']"; - } } else if ($covering instanceof CoversFunction) { $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversFunction('{$covering->function}']"; } else { diff --git a/src/Factories/Covers/CoversClass.php b/src/Factories/Covers/CoversClass.php index 934660fd..dbc3fb86 100644 --- a/src/Factories/Covers/CoversClass.php +++ b/src/Factories/Covers/CoversClass.php @@ -9,7 +9,7 @@ namespace Pest\Factories\Covers; */ final class CoversClass { - public function __construct(public string $class, public ?string $method = null) + public function __construct(public string $class) { // } diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index a7c1621e..3ac00ff1 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -175,9 +175,8 @@ final class TestCall * Sets the covered class and method. * * @param class-string $class - * @param string|null $method */ - public function covers(string $class, ?string $method = null): TestCall + public function covers(string $class): TestCall { $this->testCaseMethod->covers[] = new CoversClass(...func_get_args());