Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Yandex/Allure/Adapter/Annotation/AnnotationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ private function processAnnotations(array $annotations)
$annotation->value,
$annotation->kind
);
} elseif ($annotation instanceof Epics) {
foreach ($annotation->getEpicNames() as $epicName) {
$this->labels[] = Model\Label::epic($epicName);
}
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions src/Yandex/Allure/Adapter/Annotation/Epics.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Yandex\Allure\Adapter\Annotation;

use Doctrine\Common\Annotations\Annotation\Required;

/**
* @Annotation
* @Target({"CLASS", "METHOD"})
* @package Yandex\Allure\Adapter\Annotation
*/
class Epics
{
/**
* @var array
* @Required
*/
public $epicNames;

/**
* @return array
*/
public function getEpicNames()
{
return $this->epicNames;
}
}
13 changes: 11 additions & 2 deletions src/Yandex/Allure/Adapter/Model/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ public function getValue()
return $this->value;
}

/**
* @param $epicName
* @return Label
*/
public static function epic($epicName)
{
return new Label(LabelType::EPIC, $epicName);
}

/**
* @param $featureName
* @return Label
Expand All @@ -75,7 +84,7 @@ public static function severity($severityLevel)
{
return new Label(LabelType::SEVERITY, $severityLevel);
}

/**
* @param $testType
* @return Label
Expand Down Expand Up @@ -103,5 +112,5 @@ public static function testId($testCaseId)
{
return new Label(LabelType::TEST_ID, $testCaseId);
}

}
1 change: 1 addition & 0 deletions src/Yandex/Allure/Adapter/Model/LabelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ class LabelType
const ISSUE = 'issue';
const TEST_ID = 'testId';
const TEST_TYPE = 'testType';
const EPIC = 'epic';
}