mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Prevent duplicate attributes
This commit is contained in:
@ -759,7 +759,12 @@ final class TestCall // @phpstan-ignore-line
|
|||||||
$this->testSuite->tests->set($this->testCaseMethod);
|
$this->testSuite->tests->set($this->testCaseMethod);
|
||||||
|
|
||||||
if (! is_null($testCase = $this->testSuite->tests->get($this->filename))) {
|
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