Adds assignees

This commit is contained in:
Nuno Maduro
2024-08-03 17:05:34 +01:00
parent 6fb1133d52
commit 41e50cac05
10 changed files with 124 additions and 8 deletions

View File

@ -390,6 +390,18 @@ final class TestCall
return $this->issue($number);
}
/**
* Sets the test assignee(s).
*/
public function assignee(array|string $assignee): self
{
$assignees = is_array($assignee) ? $assignee : [$assignee];
$this->testCaseMethod->assignees = array_unique(array_merge($this->testCaseMethod->assignees, $assignees));
return $this;
}
/**
* Associates the test with the given pull request(s).
*
@ -401,7 +413,7 @@ final class TestCall
$number = array_map(fn (string|int $number): int => (int) ltrim((string) $number, '#'), $number);
$this->testCaseMethod->prs = array_merge($this->testCaseMethod->issues, $number);
$this->testCaseMethod->prs = array_unique(array_merge($this->testCaseMethod->issues, $number));
return $this;
}
@ -415,7 +427,7 @@ final class TestCall
{
$notes = is_array($note) ? $note : [$note];
$this->testCaseMethod->notes = array_merge($this->testCaseMethod->notes, $notes);
$this->testCaseMethod->notes = array_unique(array_merge($this->testCaseMethod->notes, $notes));
return $this;
}