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());