mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #1464 from gehrisandro/sandro/prevent-duplicate-attributes
Prevent duplicate attributes
This commit is contained in:
@ -759,7 +759,12 @@ final class TestCall // @phpstan-ignore-line
|
||||
$this->testSuite->tests->set($this->testCaseMethod);
|
||||
|
||||
if (! is_null($testCase = $this->testSuite->tests->get($this->filename))) {
|
||||
$testCase->attributes = array_merge($testCase->attributes, $this->testCaseFactoryAttributes);
|
||||
$attributesToMerge = array_filter(
|
||||
$this->testCaseFactoryAttributes,
|
||||
fn (Attribute $attributeToMerge): bool => array_filter($testCase->attributes, fn (Attribute $attribute): bool => serialize($attributeToMerge) === serialize($attribute)) === []
|
||||
);
|
||||
|
||||
$testCase->attributes = array_merge($testCase->attributes, $attributesToMerge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user