Merge pull request #1295 from jshayes/nested-describe

Support for nested describe blocks
This commit is contained in:
Nuno Maduro
2024-10-22 13:41:38 +01:00
committed by GitHub
26 changed files with 847 additions and 33 deletions

View File

@ -31,8 +31,10 @@ final class TestCaseMethodFactory
/**
* The test's describing, if any.
*
* @var array<int, string>
*/
public ?string $describing = null;
public array $describing = [];
/**
* The test's description, if any.
@ -201,7 +203,7 @@ final class TestCaseMethodFactory
];
foreach ($this->depends as $depend) {
$depend = Str::evaluable($this->describing !== null ? Str::describe($this->describing, $depend) : $depend);
$depend = Str::evaluable($this->describing === [] ? $depend : Str::describe($this->describing, $depend));
$this->attributes[] = new Attribute(
\PHPUnit\Framework\Attributes\Depends::class,