From 0d8a328488ae7af63c480f2dd4e2b317290955a5 Mon Sep 17 00:00:00 2001 From: jshayes Date: Mon, 11 Nov 2024 15:45:16 -0500 Subject: [PATCH] Pass description into describe call --- src/Functions.php | 3 ++- src/PendingCalls/DescribeCall.php | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Functions.php b/src/Functions.php index 1e12fe7e6..6a4f45ecc 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -18,6 +18,7 @@ use Pest\Support\Backtrace; use Pest\Support\Container; use Pest\Support\DatasetInfo; +use Pest\Support\Description; use Pest\Support\HigherOrderTapProxy; use Pest\TestSuite; use PHPUnit\Framework\TestCase; @@ -95,7 +96,7 @@ function describe(string $description, Closure $tests): DescribeCall { $filename = Backtrace::testFile(); - return new DescribeCall(TestSuite::getInstance(), $filename, $description, $tests); + return new DescribeCall(TestSuite::getInstance(), $filename, new Description($description), $tests); } } diff --git a/src/PendingCalls/DescribeCall.php b/src/PendingCalls/DescribeCall.php index e6d4bc297..bf6a7f517 100644 --- a/src/PendingCalls/DescribeCall.php +++ b/src/PendingCalls/DescribeCall.php @@ -26,21 +26,16 @@ final class DescribeCall */ private ?BeforeEachCall $currentBeforeEachCall = null; - /** - * The unique description for this describe block - */ - private readonly Description $description; - /** * Creates a new Pending Call. */ public function __construct( public readonly TestSuite $testSuite, public readonly string $filename, - string $description, + public readonly Description $description, public readonly Closure $tests ) { - $this->description = new Description($description); + // } /**