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); } }
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); } } }
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); } } } } }
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); } } }
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); } } }
public function process(Entity $context) { if ($context instanceof TestSuite) { $context->setName($this->name); } }
public function process(Entity $context) { if ($context instanceof Step) { $context->setStatus(Status::CANCELED); } }
public function process(Entity $context) { if ($context instanceof TestCase) { $context->setStop(self::getTimestamp()); } }
public function process(Entity $context) { if ($context instanceof TestCase) { $context->addParameter(new Parameter($this->name, $this->value, $this->kind)); } }