private function processAnnotations(array $annotations)
 {
     foreach ($annotations as $annotation) {
         if ($annotation instanceof Title) {
             $this->title = $annotation->value;
         } elseif ($annotation instanceof Description) {
             $this->description = new Model\Description($annotation->type, $annotation->value);
         } elseif ($annotation instanceof Features) {
             foreach ($annotation->getFeatureNames() as $featureName) {
                 $this->labels[] = Model\Label::feature($featureName);
             }
         } elseif ($annotation instanceof Stories) {
             foreach ($annotation->getStories() as $issueKey) {
                 $this->labels[] = Model\Label::story($issueKey);
             }
         } elseif ($annotation instanceof Issues) {
             foreach ($annotation->getIssueKeys() as $issueKey) {
                 $this->labels[] = Model\Label::issue($issueKey);
             }
         } elseif ($annotation instanceof Severity) {
             $this->labels[] = Model\Label::severity(ConstantChecker::validate('Yandex\\Allure\\Adapter\\Model\\SeverityLevel', $annotation->level));
         } elseif ($annotation instanceof Parameter) {
             $this->parameters[] = new Model\Parameter($annotation->name, $annotation->value, $annotation->kind);
         }
     }
 }
Example #2
0
 /**
  * @param string $status
  */
 public function setStatus($status)
 {
     $this->status = ConstantChecker::validate('Yandex\\Allure\\Adapter\\Model\\Status', $status);
 }
 public function __construct($name, $value, $kind = ParameterKind::SYSTEM_PROPERTY)
 {
     $this->kind = ConstantChecker::validate('Yandex\\Allure\\Adapter\\Model\\ParameterKind', $kind);
     $this->name = $name;
     $this->value = $value;
 }
 /**
  * @expectedException \Yandex\Allure\Adapter\AllureException
  */
 public function testConstantIsMissing()
 {
     ConstantChecker::validate(self::CLASS_NAME, 'missing-value');
 }
 public function __construct($type, $value)
 {
     $this->type = ConstantChecker::validate('Yandex\\Allure\\Adapter\\Model\\DescriptionType', $type);
     $this->value = $value;
 }