Skip to content

Commit 48598f4

Browse files
scaytrasebaev
authored andcommitted
merge annotations instead of replace (fixes #42, via #43)
1 parent 56fca01 commit 48598f4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Yandex/Allure/Adapter/AllureAdapter.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,15 @@ public function testStart(TestEvent $testEvent)
258258
$event = new TestCaseStartedEvent($this->uuid, $testName);
259259
if ($test instanceof Cest) {
260260
$className = get_class($test->getTestClass());
261+
$annotations = [];
261262
if (class_exists($className, false)) {
262-
$annotationManager = new Annotation\AnnotationManager(
263-
Annotation\AnnotationProvider::getClassAnnotations($className));
264-
$annotationManager->updateTestCaseEvent($event);
263+
$annotations = array_merge($annotations, Annotation\AnnotationProvider::getClassAnnotations($className));
265264
}
266265
if (method_exists($className, $test->getName())){
267-
$annotationManager = new Annotation\AnnotationManager(
268-
Annotation\AnnotationProvider::getMethodAnnotations($className, $test->getName()));
269-
$annotationManager->updateTestCaseEvent($event);
266+
$annotations = array_merge($annotations, Annotation\AnnotationProvider::getMethodAnnotations($className, $test->getName()));
270267
}
268+
$annotationManager = new Annotation\AnnotationManager($annotations);
269+
$annotationManager->updateTestCaseEvent($event);
271270
} else if ($test instanceof Gherkin) {
272271
$featureTags = $test->getFeatureNode()->getTags();
273272
$scenarioTags = $test->getScenarioNode()->getTags();

0 commit comments

Comments
 (0)