Skip to content

Commit

Permalink
Allow multiple test dependencies
Browse files Browse the repository at this point in the history
The Depends attribute can be added multiple times to tests now to indicate dependencies on various other tests.

Fixes #6675
  • Loading branch information
mbrodala committed Jul 12, 2023
1 parent 237630e commit 9a87796
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Codeception/Test/Cest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ public function fetchDependencies(): array
{
$names = [];
foreach ($this->getMetadata()->getDependencies() as $required) {
if (!str_contains($required, ':') && method_exists($this->getTestInstance(), $required)) {
$required = $this->testClass . ":{$required}";
foreach ((array)$dependency as $required) {
if (!str_contains($required, ':') && method_exists($this->getTestInstance(), $required)) {
$required = $this->testClass . ":{$required}";
}
$names[] = $required;
}
$names[] = $required;
}
Expand Down

0 comments on commit 9a87796

Please sign in to comment.