コード例 #1
0
 public function process(Entity $context)
 {
     if ($context instanceof Step) {
         $newFileName = $this->getAttachmentFileName($this->filePathOrContents, $this->type);
         $attachment = new Attachment($this->caption, $newFileName, $this->type);
         $context->addAttachment($attachment);
     }
 }
コード例 #2
0
 public function process(Entity $context)
 {
     if ($context instanceof Step) {
         $context->setName($this->name);
         $context->setStatus(Status::PASSED);
         $context->setStart(self::getTimestamp());
         $context->setTitle($this->title);
     }
 }
 public function process(Entity $context)
 {
     if ($context instanceof TestCase) {
         $context->setStatus($this->getStatus());
         $exception = $this->exception;
         if (isset($exception)) {
             $failure = new Failure($this->message);
             $failure->setStackTrace($exception->getTraceAsString());
             $context->setFailure($failure);
         }
     }
 }
コード例 #4
0
 public function process(Entity $context)
 {
     if ($context instanceof Step) {
         foreach ($context->getAttachments() as $index => $attachment) {
             if ($attachment instanceof Attachment) {
                 $path = $attachment->getSource();
                 if (preg_match($this->pattern, $path)) {
                     if (file_exists($path) && is_writable($path)) {
                         unlink($path);
                     }
                     $context->removeAttachment($index);
                 }
             }
         }
     }
 }
コード例 #5
0
 public function process(Entity $context)
 {
     if ($context instanceof TestCase) {
         $context->setName($this->getName());
         $context->setStatus(Status::PASSED);
         $context->setStart(self::getTimestamp());
         $context->setTitle($this->getTitle());
         $description = $this->getDescription();
         if (isset($description)) {
             $context->setDescription($description);
         }
         foreach ($this->getLabels() as $label) {
             $context->addLabel($label);
         }
         foreach ($this->getParameters() as $parameter) {
             $context->addParameter($parameter);
         }
     }
 }
コード例 #6
0
 public function process(Entity $context)
 {
     if ($context instanceof TestSuite) {
         $context->setName($this->getName());
         $context->setStart(self::getTimestamp());
         $context->setTitle($this->getTitle());
         $description = $this->getDescription();
         if (isset($description)) {
             $context->setDescription($this->getDescription());
         }
         foreach ($this->getLabels() as $label) {
             $context->addLabel($label);
         }
     }
 }
コード例 #7
0
 public function process(Entity $context)
 {
     if ($context instanceof TestSuite) {
         $context->setName($this->name);
     }
 }
コード例 #8
0
 public function process(Entity $context)
 {
     if ($context instanceof Step) {
         $context->setStatus(Status::CANCELED);
     }
 }
コード例 #9
0
 public function process(Entity $context)
 {
     if ($context instanceof TestCase) {
         $context->setStop(self::getTimestamp());
     }
 }
コード例 #10
0
 public function process(Entity $context)
 {
     if ($context instanceof TestCase) {
         $context->addParameter(new Parameter($this->name, $this->value, $this->kind));
     }
 }