longyi 5 vuotta sitten
vanhempi
commit
c9405dd336
100 muutettua tiedostoa jossa 6978 lisäystä ja 1 poistoa
  1. 0 1
      .gitignore
  2. 5 0
      vendor/allure-framework/allure-codeception/.gitignore
  3. 13 0
      vendor/allure-framework/allure-codeception/LICENSE
  4. 57 0
      vendor/allure-framework/allure-codeception/README.md
  5. 30 0
      vendor/allure-framework/allure-codeception/composer.json
  6. 546 0
      vendor/allure-framework/allure-codeception/src/Yandex/Allure/Codeception/AllureCodeception.php
  7. 17 0
      vendor/allure-framework/allure-php-api/.github/release-drafter.yml
  8. 22 0
      vendor/allure-framework/allure-php-api/.github/workflows/build.yml
  9. 14 0
      vendor/allure-framework/allure-php-api/.github/workflows/draft-release.yml
  10. 5 0
      vendor/allure-framework/allure-php-api/.gitignore
  11. 13 0
      vendor/allure-framework/allure-php-api/LICENSE
  12. 44 0
      vendor/allure-framework/allure-php-api/README.md
  13. 37 0
      vendor/allure-framework/allure-php-api/composer.json
  14. 1979 0
      vendor/allure-framework/allure-php-api/composer.lock
  15. 4 0
      vendor/allure-framework/allure-php-api/phpunit.php
  16. 24 0
      vendor/allure-framework/allure-php-api/phpunit.xml
  17. 216 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php
  18. 7 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/AllureException.php
  19. 19 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AllureId.php
  20. 185 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationManager.php
  21. 107 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationProvider.php
  22. 25 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Description.php
  23. 27 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Features.php
  24. 27 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Issues.php
  25. 27 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Label.php
  26. 17 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Labels.php
  27. 31 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Parameter.php
  28. 19 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Parameters.php
  29. 18 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Severity.php
  30. 27 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Stories.php
  31. 27 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/TestCaseId.php
  32. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/TestType.php
  33. 19 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Title.php
  34. 136 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddAttachmentEvent.php
  35. 29 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddParameterEvent.php
  36. 12 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/ClearStepStorageEvent.php
  37. 12 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/ClearTestCaseStorageEvent.php
  38. 10 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Event.php
  39. 34 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/RemoveAttachmentsEvent.php
  40. 17 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepCanceledEvent.php
  41. 7 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepEvent.php
  42. 17 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepFailedEvent.php
  43. 19 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepFinishedEvent.php
  44. 39 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepStartedEvent.php
  45. 96 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/StepStorage.php
  46. 43 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/TestCaseStorage.php
  47. 53 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/TestSuiteStorage.php
  48. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseBrokenEvent.php
  49. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseCanceledEvent.php
  50. 7 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseEvent.php
  51. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseFailedEvent.php
  52. 19 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseFinishedEvent.php
  53. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCasePendingEvent.php
  54. 196 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseStartedEvent.php
  55. 60 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseStatusChangedEvent.php
  56. 11 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteEvent.php
  57. 34 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteFinishedEvent.php
  58. 166 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteStartedEvent.php
  59. 65 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Attachment.php
  60. 33 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/ConstantChecker.php
  61. 50 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Description.php
  62. 14 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/DescriptionType.php
  63. 11 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Entity.php
  64. 54 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Failure.php
  65. 125 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Label.php
  66. 14 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/LabelType.php
  67. 62 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Parameter.php
  68. 14 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/ParameterKind.php
  69. 28 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Provider.php
  70. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/SeverityLevel.php
  71. 16 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Status.php
  72. 189 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Step.php
  73. 275 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/TestCase.php
  74. 271 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/TestSuite.php
  75. 26 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/AttachmentSupport.php
  76. 61 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/StepSupport.php
  77. 25 0
      vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/Utils.php
  78. 170 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/AllureTest.php
  79. 167 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/AnnotationManagerTest.php
  80. 60 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/AnnotationProviderTest.php
  81. 16 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ClassWithAnnotations.php
  82. 16 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ClassWithIgnoreAnnotation.php
  83. 45 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ExampleTestSuite.php
  84. 16 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/TestAnnotation.php
  85. 84 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/AddAttachmentEventTest.php
  86. 29 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/AddParameterEventTest.php
  87. 41 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/RemoveAttachmentsEventTest.php
  88. 24 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepCanceledEventTest.php
  89. 24 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepFailedEventTest.php
  90. 16 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepFinishedEventTest.php
  91. 26 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepStartedEventTest.php
  92. 26 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepStatusChangedEventTest.php
  93. 17 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/Fixtures/MockedRootStepStorage.php
  94. 27 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/StepStorageTest.php
  95. 28 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/TestCaseStorageTest.php
  96. 20 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/TestSuiteStorageTest.php
  97. 24 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseBrokenEventTest.php
  98. 24 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseCanceledEventTest.php
  99. 24 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseFailedEventTest.php
  100. 0 0
      vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseFinishedEventTest.php

+ 0 - 1
.gitignore

@@ -60,7 +60,6 @@ atlassian*
 
 /var/*
 !/var/.htaccess
-/vendor/*
 !/vendor/.htaccess
 /generated/*
 !/generated/.htaccess

+ 5 - 0
vendor/allure-framework/allure-codeception/.gitignore

@@ -0,0 +1,5 @@
+*.iml
+.idea
+vendor/*
+composer.phar
+composer.lock

+ 13 - 0
vendor/allure-framework/allure-codeception/LICENSE

@@ -0,0 +1,13 @@
+Copyright 2014 Yandex LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

+ 57 - 0
vendor/allure-framework/allure-codeception/README.md

@@ -0,0 +1,57 @@
+# Allure Codeception Adapter
+
+This is an official [Codeception](http://codeception.com) adapter for Allure Framework.
+
+## What is this for?
+The main purpose of this adapter is to accumulate information about your tests and write it out to a set of XML files: one for each test class. This adapter only generates XML files containing information about tests. See [wiki section](https://github.com/allure-framework/allure-core/wiki#generating-report) on how to generate report.
+
+## Example project
+Example project is located at: https://github.com/allure-examples/allure-codeception-example
+
+## Installation and Usage
+In order to use this adapter you need to add a new dependency to your **composer.json** file:
+```
+{
+    "require": {
+	    "php": ">=5.4.0",
+	    "allure-framework/allure-codeception": ">=1.1.0"
+    }
+}
+```
+To enable this adapter in Codeception tests simply put it in "enabled" extensions section of **codeception.yml**:
+```yaml
+extensions:
+    enabled:
+        - Yandex\Allure\Adapter\AllureAdapter
+    config:
+        Yandex\Allure\Adapter\AllureAdapter:
+            deletePreviousResults: false
+            outputDirectory: allure-results
+            ignoredAnnotations:
+                - env
+                - dataprovider
+```
+
+`deletePreviousResults` will clear all `.xml` files from output directory (this
+behavior may change to complete cleanup later). It is set to `false` by default.
+
+`outputDirectory` is used to store Allure results and will be calculated
+relatively to Codeception output directory (also known as `paths: log` in
+codeception.yml) unless you specify an absolute path. You can traverse up using
+`..` as usual. `outputDirectory` defaults to `allure-results`.
+
+`ignoredAnnotations` is used to define extra custom annotations to ignore. It is empty by default.
+
+To generate report from your favourite terminal,
+[install](https://github.com/allure-framework/allure-cli#installation)
+allure-cli and run following command (assuming you're in project root and using
+default configuration):
+
+```bash
+allure generate --report-version 1.4.5 --report-path tests/_output/allure-report -- tests/_output/allure-results
+```
+
+Report will be generated in `tests/_output/allure-report`.
+
+## Main features
+See respective [PHPUnit](https://github.com/allure-framework/allure-phpunit#advanced-features) section.

+ 30 - 0
vendor/allure-framework/allure-codeception/composer.json

@@ -0,0 +1,30 @@
+{
+    "name": "allure-framework/allure-codeception",
+    "keywords":["codeception", "testing", "report", "steps", "attachments", "cases", "allure"],
+    "description": "A Codeception adapter for Allure report.",
+    "homepage": "http://allure.qatools.ru/",
+    "license": "Apache-2.0",
+    "authors": [
+        {
+            "name": "Ivan Krutov",
+            "email": "vania-pooh@yandex-team.ru",
+	        "role": "Developer"
+        }
+    ],
+    "support": {
+        "email": "allure@yandex-team.ru",
+        "source": "https://github.com/allure-framework/allure-codeception"
+    },
+    "require": {
+	    "php": ">=5.4.0",
+        "codeception/codeception": "~2.1",
+        "allure-framework/allure-php-api": "~1.1.0",
+        "symfony/filesystem": ">=2.6",
+        "symfony/finder": ">=2.6"
+    },
+    "autoload": {
+        "psr-0": {
+            "Yandex": "src/"
+        }
+    }
+}

+ 546 - 0
vendor/allure-framework/allure-codeception/src/Yandex/Allure/Codeception/AllureCodeception.php

@@ -0,0 +1,546 @@
+<?php
+namespace Yandex\Allure\Codeception;
+
+use Codeception\Configuration;
+use Codeception\Event\FailEvent;
+use Codeception\Event\StepEvent;
+use Codeception\Event\SuiteEvent;
+use Codeception\Event\TestEvent;
+use Codeception\Events;
+use Codeception\Exception\ConfigurationException;
+use Codeception\Platform\Extension;
+use Codeception\Test\Cept;
+use Codeception\Test\Cest;
+use Codeception\Test\Gherkin;
+use Codeception\Util\Debug;
+use Codeception\Util\Locator;
+use Symfony\Component\Filesystem\Filesystem;
+use Symfony\Component\Finder\Finder;
+use Yandex\Allure\Adapter\Allure;
+use Yandex\Allure\Adapter\Annotation;
+use Yandex\Allure\Adapter\Annotation\Description;
+use Yandex\Allure\Adapter\Annotation\Features;
+use Yandex\Allure\Adapter\Annotation\Issues;
+use Yandex\Allure\Adapter\Annotation\Stories;
+use Yandex\Allure\Adapter\Annotation\Title;
+use Yandex\Allure\Adapter\Event\AddParameterEvent;
+use Yandex\Allure\Adapter\Event\StepFinishedEvent;
+use Yandex\Allure\Adapter\Event\StepStartedEvent;
+use Yandex\Allure\Adapter\Event\TestCaseBrokenEvent;
+use Yandex\Allure\Adapter\Event\TestCaseCanceledEvent;
+use Yandex\Allure\Adapter\Event\TestCaseFailedEvent;
+use Yandex\Allure\Adapter\Event\TestCaseFinishedEvent;
+use Yandex\Allure\Adapter\Event\TestCasePendingEvent;
+use Yandex\Allure\Adapter\Event\TestCaseStartedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteFinishedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteStartedEvent;
+use Yandex\Allure\Adapter\Model;
+use Yandex\Allure\Adapter\Model\Label;
+use Yandex\Allure\Adapter\Model\LabelType;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+use function GuzzleHttp\json_encode;
+
+const ARGUMENTS_LENGTH = 'arguments_length';
+const OUTPUT_DIRECTORY_PARAMETER = 'outputDirectory';
+const DELETE_PREVIOUS_RESULTS_PARAMETER = 'deletePreviousResults';
+const IGNORED_ANNOTATION_PARAMETER = 'ignoredAnnotations';
+const DEFAULT_RESULTS_DIRECTORY = 'allure-results';
+const DEFAULT_REPORT_DIRECTORY = 'allure-report';
+const INITIALIZED_PARAMETER = '_initialized';
+
+class AllureCodeception extends Extension
+{
+    //NOTE: here we implicitly assume that PHP runs in single-threaded mode
+    private $uuid;
+
+    /**
+     * @var Allure
+     */
+    private $lifecycle;
+
+    static $events = [
+        Events::SUITE_BEFORE => 'suiteBefore',
+        Events::SUITE_AFTER => 'suiteAfter',
+        Events::TEST_START => 'testStart',
+        Events::TEST_FAIL => 'testFail',
+        Events::TEST_ERROR => 'testError',
+        Events::TEST_INCOMPLETE => 'testIncomplete',
+        Events::TEST_SKIPPED => 'testSkipped',
+        Events::TEST_END => 'testEnd',
+        Events::STEP_BEFORE => 'stepBefore',
+        Events::STEP_AFTER => 'stepAfter'
+    ];
+
+    /**
+     * Annotations that should be ignored by the annotaions parser (especially PHPUnit annotations).
+     * 
+     * @var array
+     */
+    private $ignoredAnnotations = [
+        'after', 'afterClass', 'backupGlobals', 'backupStaticAttributes', 'before', 'beforeClass',
+        'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'covers',
+        'coversDefaultClass', 'coversNothing', 'dataProvider', 'depends', 'expectedException',
+        'expectedExceptionCode', 'expectedExceptionMessage', 'group', 'large', 'medium',
+        'preserveGlobalState', 'requires', 'runTestsInSeparateProcesses', 'runInSeparateProcess',
+        'small', 'test', 'testdox', 'ticket', 'uses',
+    ];
+
+    /**
+     * Extra annotations to ignore in addition to standard PHPUnit annotations.
+     * 
+     * @param array $ignoredAnnotations
+     */
+    public function _initialize(array $ignoredAnnotations = [])
+    {
+        parent::_initialize();
+        Annotation\AnnotationProvider::registerAnnotationNamespaces();
+        // Add standard PHPUnit annotations
+        Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
+        // Add custom ignored annotations
+        $ignoredAnnotations = $this->tryGetOption(IGNORED_ANNOTATION_PARAMETER, []);
+        Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
+        $outputDirectory = $this->getOutputDirectory();
+        $deletePreviousResults =
+            $this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
+        $this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
+        if (is_null(Model\Provider::getOutputDirectory())) {
+            Model\Provider::setOutputDirectory($outputDirectory);
+        }
+        $this->setOption(INITIALIZED_PARAMETER, true);
+    }
+
+    /**
+     * Sets runtime option which will be live
+     *
+     * @param string $key
+     * @param mixed $value
+     */
+    private function setOption($key, $value)
+    {
+        $config = [];
+        $cursor = &$config;
+        $path = ['extensions', 'config', get_class()];
+        foreach ($path as $segment) {
+            $cursor[$segment] = [];
+            $cursor = &$cursor[$segment];
+        }
+        $cursor[$key] = $this->config[$key] = $value;
+        Configuration::append($config);
+    }
+
+    /**
+     * Retrieves option or returns default value.
+     *
+     * @param string $optionKey    Configuration option key.
+     * @param mixed  $defaultValue Value to return in case option isn't set.
+     *
+     * @return mixed Option value.
+     * @since 0.1.0
+     */
+    private function tryGetOption($optionKey, $defaultValue = null)
+    {
+        if (array_key_exists($optionKey, $this->config)) {
+            return $this->config[$optionKey];
+        } 
+        return $defaultValue;
+    }
+
+    /** @noinspection PhpUnusedPrivateMethodInspection */
+    /**
+     * Retrieves option or dies.
+     *
+     * @param string $optionKey Configuration option key.
+     *
+     * @throws ConfigurationException Thrown if option can't be retrieved.
+     *
+     * @return mixed Option value.
+     * @since 0.1.0
+     */
+    private function getOption($optionKey)
+    {
+        if (!array_key_exists($optionKey, $this->config)) {
+            $template = '%s: Couldn\'t find required configuration option `%s`';
+            $message = sprintf($template, __CLASS__, $optionKey);
+            throw new ConfigurationException($message);
+        }
+        return $this->config[$optionKey];
+    }
+
+    /**
+     * Returns output directory.
+     *
+     * @throws ConfigurationException Thrown if there is Codeception-wide
+     *                                problem with output directory
+     *                                configuration.
+     *
+     * @return string Absolute path to output directory.
+     * @since 0.1.0
+     */
+    private function getOutputDirectory()
+    {
+        $outputDirectory = $this->tryGetOption(
+            OUTPUT_DIRECTORY_PARAMETER,
+            DEFAULT_RESULTS_DIRECTORY
+        );
+        $filesystem = new Filesystem;
+        if (!$filesystem->isAbsolutePath($outputDirectory)) {
+            $outputDirectory = Configuration::outputDir() . $outputDirectory;
+        }
+        return $outputDirectory;
+    }
+
+    /**
+     * Creates output directory (if it hasn't been created yet) and cleans it
+     * up (if corresponding argument has been set to true).
+     *
+     * @param string $outputDirectory
+     * @param bool   $deletePreviousResults Whether to delete previous results
+     *                                      or keep 'em.
+     *
+     * @since 0.1.0
+     */
+    private function prepareOutputDirectory(
+        $outputDirectory,
+        $deletePreviousResults = false
+    ) {
+        $filesystem = new Filesystem;
+        $filesystem->mkdir($outputDirectory, 0775);
+        $initialized = $this->tryGetOption(INITIALIZED_PARAMETER, false);
+        if ($deletePreviousResults && !$initialized) {
+            $finder = new Finder;
+            $files = $finder->files()->in($outputDirectory)->name('*.xml');
+            $filesystem->remove($files);
+        }
+    }
+
+    public function suiteBefore(SuiteEvent $suiteEvent)
+    {
+        $suite = $suiteEvent->getSuite();
+        $suiteName = $suite->getName();
+        $event = new TestSuiteStartedEvent($suiteName);
+        if (class_exists($suiteName, false)) {
+            $annotationManager = new Annotation\AnnotationManager(
+                Annotation\AnnotationProvider::getClassAnnotations($suiteName)
+            );
+            $annotationManager->updateTestSuiteEvent($event);
+        }
+        $this->uuid = $event->getUuid();
+        $this->getLifecycle()->fire($event);
+    }
+
+    public function suiteAfter()
+    {
+        $this->getLifecycle()->fire(new TestSuiteFinishedEvent($this->uuid));
+    }
+
+    private $testInvocations = array();
+    private function buildTestName($test) {
+        $testName = $test->getName();
+        if ($test instanceof Cest) {
+            $testFullName = get_class($test->getTestClass()) . '::' . $testName;
+            if(isset($this->testInvocations[$testFullName])) {
+                $this->testInvocations[$testFullName]++;
+            } else {
+                $this->testInvocations[$testFullName] = 0;
+            }
+            $currentExample = $test->getMetadata()->getCurrent();
+            if ($currentExample && isset($currentExample['example']) ) {
+                $testName .= ' with data set #' . $this->testInvocations[$testFullName];
+            }
+        } else if($test instanceof Gherkin) {
+            $testName = $test->getMetadata()->getFeature();
+        }
+        return $testName;
+    }
+
+    public function testStart(TestEvent $testEvent)
+    {
+        $test = $testEvent->getTest();
+        $testName = $this->buildTestName($test);
+        $event = new TestCaseStartedEvent($this->uuid, $testName);        
+        if ($test instanceof Cest) {
+            $className = get_class($test->getTestClass());
+            $annotations = [];
+            if (class_exists($className, false)) {
+                $annotations = array_merge($annotations, Annotation\AnnotationProvider::getClassAnnotations($className));
+            }
+            if (method_exists($className, $test->getName())){
+                $annotations = array_merge($annotations, Annotation\AnnotationProvider::getMethodAnnotations($className, $test->getName()));
+            }
+            $annotationManager = new Annotation\AnnotationManager($annotations);
+            $annotationManager->updateTestCaseEvent($event);
+        } else if ($test instanceof Gherkin) {
+            $featureTags = $test->getFeatureNode()->getTags();
+            $scenarioTags = $test->getScenarioNode()->getTags();
+            $event->setLabels(
+                    array_map(
+                            function ($a) {
+                                return new Label($a, LabelType::FEATURE);
+                            },
+                            array_merge($featureTags, $scenarioTags)
+                        )
+                );
+        } else if ($test instanceof Cept) {
+            $annotations = $this->getCeptAnnotations($test);
+            if (count($annotations) > 0) {
+                $annotationManager = new Annotation\AnnotationManager($annotations);
+                $annotationManager->updateTestCaseEvent($event);
+            }
+        } else if ($test instanceof \PHPUnit_Framework_TestCase) {
+            $methodName = $this->methodName = $test->getName(false);
+            $className = get_class($test);
+            if (class_exists($className, false)) {
+                $annotationManager = new Annotation\AnnotationManager(
+                    Annotation\AnnotationProvider::getClassAnnotations($className)
+                );
+                $annotationManager->updateTestCaseEvent($event);
+            }
+            if (method_exists($test, $methodName)) {
+                $annotationManager = new Annotation\AnnotationManager(
+                    Annotation\AnnotationProvider::getMethodAnnotations(get_class($test), $methodName)
+                );
+                $annotationManager->updateTestCaseEvent($event);
+            }
+        }
+        $this->getLifecycle()->fire($event);
+
+        if ($test instanceof Cest) {
+            $currentExample = $test->getMetadata()->getCurrent();
+            if ($currentExample && isset($currentExample['example']) ) {
+                foreach ($currentExample['example'] as $name => $param) {
+                    $paramEvent = new AddParameterEvent(
+                            $name, $this->stringifyArgument($param), ParameterKind::ARGUMENT);
+                    $this->getLifecycle()->fire($paramEvent);
+                }
+            }
+        } else if ($test instanceof \PHPUnit_Framework_TestCase) {
+            if ($test->usesDataProvider()) {
+                $method = new \ReflectionMethod(get_class($test), 'getProvidedData');
+                $method->setAccessible(true);
+                $testMethod = new \ReflectionMethod(get_class($test), $test->getName(false));
+                $paramNames = $testMethod->getParameters();
+                foreach ($method->invoke($test) as $key => $param) {
+                    $paramName = array_shift($paramNames);
+                    $paramEvent = new AddParameterEvent(
+                            is_null($paramName)
+                                ? $key
+                                : $paramName->getName(),
+                            $this->stringifyArgument($param),
+                            ParameterKind::ARGUMENT);
+                    $this->getLifecycle()->fire($paramEvent);
+                }
+            }
+        }
+    }
+
+    /**
+     * @param FailEvent $failEvent
+     */
+    public function testError(FailEvent $failEvent)
+    {
+        $event = new TestCaseBrokenEvent();
+        $e = $failEvent->getFail();
+        $message = $e->getMessage();
+        $this->getLifecycle()->fire($event->withException($e)->withMessage($message));
+    }
+
+    /**
+     * @param FailEvent $failEvent
+     */
+    public function testFail(FailEvent $failEvent)
+    {
+        $event = new TestCaseFailedEvent();
+        $e = $failEvent->getFail();
+        $message = $e->getMessage();
+        $this->getLifecycle()->fire($event->withException($e)->withMessage($message));
+    }
+
+    /**
+     * @param FailEvent $failEvent
+     */
+    public function testIncomplete(FailEvent $failEvent)
+    {
+        $event = new TestCasePendingEvent();
+        $e = $failEvent->getFail();
+        $message = $e->getMessage();
+        $this->getLifecycle()->fire($event->withException($e)->withMessage($message));
+    }
+
+    /**
+     * @param FailEvent $failEvent
+     */
+    public function testSkipped(FailEvent $failEvent)
+    {
+        $event = new TestCaseCanceledEvent();
+        $e = $failEvent->getFail();
+        $message = $e->getMessage();
+        $this->getLifecycle()->fire($event->withException($e)->withMessage($message));
+    }
+
+    public function testEnd()
+    {
+        $this->getLifecycle()->fire(new TestCaseFinishedEvent());
+    }
+
+    public function stepBefore(StepEvent $stepEvent)
+    {
+        $argumentsLength = $this->tryGetOption(ARGUMENTS_LENGTH, 200);
+
+        $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments();
+        $stepArgs = $stepEvent->getStep()->getArgumentsAsString($argumentsLength);
+
+        if (!trim($stepAction)) {
+            $stepAction = $stepEvent->getStep()->getMetaStep()->getHumanizedActionWithoutArguments();
+            $stepArgs = $stepEvent->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength);
+        }
+
+        $stepName = $stepAction . ' ' . $stepArgs;
+
+        //Workaround for https://github.com/allure-framework/allure-core/issues/442
+        $stepName = str_replace('.', '•', $stepName);
+
+        $this->emptyStep = false;
+        $this->getLifecycle()->fire(new StepStartedEvent($stepName));
+}
+
+    public function stepAfter()
+    {
+        $this->getLifecycle()->fire(new StepFinishedEvent());
+    }
+
+
+    /**
+     * @return Allure
+     */
+    public function getLifecycle()
+    {
+        if (!isset($this->lifecycle)){
+            $this->lifecycle = Allure::lifecycle();
+        }
+        return $this->lifecycle;
+    }
+
+    public function setLifecycle(Allure $lifecycle)
+    {
+        $this->lifecycle = $lifecycle;
+    }
+
+    /**
+     *
+     * @param \Codeception\TestInterface $test
+     * @return array
+     */
+    private function getCeptAnnotations($test)
+    {
+        $tokens = token_get_all($test->getSourceCode());
+        $comments = array();
+        $annotations = [];
+        foreach($tokens as $token) {
+            if($token[0] == T_DOC_COMMENT || $token[0] == T_COMMENT) {
+                $comments[] = $token[1];
+            }
+        }
+        foreach($comments as $comment) {
+            $lines = preg_split ('/$\R?^/m', $comment);
+            foreach($lines as $line) {
+                $output = [];
+                if (preg_match('/\*\s\@(.*)\((.*)\)/', $line, $output) > 0) {
+                    if ($output[1] == "Features") {
+                        $feature = new Features();
+                        $features = $this->splitAnnotationContent($output[2]);
+                        foreach($features as $featureName) {
+                            $feature->featureNames[] = $featureName;
+                        }
+                        $annotations[get_class($feature)] = $feature;
+                    } else if ($output[1] == 'Title') {
+                        $title = new Title();
+                        $title_content = str_replace('"', '', $output[2]);
+                        $title->value = $title_content;
+                        $annotations[get_class($title)] = $title;
+                    } else if ($output[1] == 'Description') {
+                        $description = new Description();
+                        $description_content = str_replace('"', '', $output[2]);
+                        $description->value = $description_content;
+                        $annotations[get_class($description)] = $description;
+                    } else if ($output[1] == 'Stories') {
+                        $stories = $this->splitAnnotationContent($output[2]);
+                        $story = new Stories();
+                        foreach($stories as $storyName) {
+                            $story->stories[] = $storyName;
+                        }
+                        $annotations[get_class($story)] = $story;
+                    } else if ($output[1] == 'Issues') {
+                        $issues = $this->splitAnnotationContent($output[2]);
+                        $issue = new Issues();
+                        foreach($issues as $issueName) {
+                            $issue->issueKeys[] = $issueName;
+                        }
+                        $annotations[get_class($issue)] = $issue;
+                    } else {
+                        Debug::debug("Tag not detected: ".$output[1]);
+                    }
+                }
+            }
+        }
+        return $annotations;
+    }
+
+    /**
+     *
+     * @param string $string
+     * @return array
+     */
+    private function splitAnnotationContent($string)
+    {
+        $parts = [];
+        $detected = str_replace('{', '', $string);
+        $detected = str_replace('}', '', $detected);
+        $detected = str_replace('"', '', $detected);
+        $parts = explode(',', $detected);
+        if (count($parts) == 0 && count($detected) > 0) {
+            $parts[] = $detected;
+        }
+        return $parts;
+    }
+
+    protected function stringifyArgument($argument)
+    {
+        if (is_string($argument)) {
+            return '"' . strtr($argument, ["\n" => '\n', "\r" => '\r', "\t" => ' ']) . '"';
+        } elseif (is_resource($argument)) {
+            $argument = (string)$argument;
+        } elseif (is_array($argument)) {
+            foreach ($argument as $key => $value) {
+                if (is_object($value)) {
+                    $argument[$key] = $this->getClassName($value);
+}
+            }
+        } elseif (is_object($argument)) {
+            if (method_exists($argument, '__toString')) {
+                $argument = (string)$argument;
+            } elseif (get_class($argument) == 'Facebook\WebDriver\WebDriverBy') {
+                $argument = Locator::humanReadableString($argument);
+            } else {
+                $argument = $this->getClassName($argument);
+            }
+        }
+
+        return json_encode($argument, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+    }
+
+    protected function getClassName($argument)
+    {
+        if ($argument instanceof \Closure) {
+            return 'Closure';
+        } elseif ((isset($argument->__mocked))) {
+            return $this->formatClassName($argument->__mocked);
+        } else {
+            return $this->formatClassName(get_class($argument));
+        }
+    }
+
+    protected function formatClassName($classname)
+    {
+        return trim($classname, "\\");
+    }
+}

+ 17 - 0
vendor/allure-framework/allure-php-api/.github/release-drafter.yml

@@ -0,0 +1,17 @@
+name-template: '$NEXT_MINOR_VERSION'
+tag-template: '$NEXT_MINOR_VERSION'
+categories:
+  - title: '🚀 New Features'
+    label: 'type:new feature'
+  - title: '🔬 Improvements'
+    label: 'type:improvement'
+  - title: '🐞 Bug Fixes'
+    label: 'type:bug'
+  - title: '📦 Dependency updates'
+    label: ' type:dependency'
+
+change-template: '* $TITLE (via #$NUMBER) - @$AUTHOR'
+template: |
+  $CHANGES
+  ## 👀 Links
+  [Commits since $PREVIOUS_TAG](https://github.com/allure-framework/allure-php-commons/compare/$PREVIOUS_TAG...master)

+ 22 - 0
vendor/allure-framework/allure-php-api/.github/workflows/build.yml

@@ -0,0 +1,22 @@
+name: Build
+
+on:
+  pull_request:
+    branches:
+      - '*'
+  push:
+    branches:
+      - 'master'
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v1
+      - uses: shivammathur/setup-php@v2
+        with:
+          php-version: '7.3'
+      - name: Install
+        run: composer install
+      - name: Test
+        run: composer test

+ 14 - 0
vendor/allure-framework/allure-php-api/.github/workflows/draft-release.yml

@@ -0,0 +1,14 @@
+name: Release Draft
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  update_draft_release:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: toolmantim/release-drafter@v5.2.0
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 5 - 0
vendor/allure-framework/allure-php-api/.gitignore

@@ -0,0 +1,5 @@
+*.iml
+.idea
+nbproject
+vendor/*
+composer.phar

+ 13 - 0
vendor/allure-framework/allure-php-api/LICENSE

@@ -0,0 +1,13 @@
+Copyright 2014 Yandex LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

+ 44 - 0
vendor/allure-framework/allure-php-api/README.md

@@ -0,0 +1,44 @@
+# Allure PHP API
+This repository contains PHP API for Allure framework. The main idea is to reuse this API when creating adapters for different test frameworks.
+
+## Getting started
+In order to use this API you simply need to add the following to **composer.json**:
+```json
+{
+    "require": {
+        "php": ">=5.4.0",
+        "allure-framework/allure-php-api": "~1.0.0"
+    }
+}
+```
+Basic usage idiom is to fire an event like the following:
+```php
+Allure::lifecycle()->fire(new TestCaseFinishedEvent());
+```
+
+## Events
+The following events are available right now:
+* AddAttachmentEvent
+* AddParameterEvent
+* ClearStepStorageEvent
+* ClearTestCaseStorageEvent
+* RemoveAttachmentsEvent
+* StepCanceledEvent
+* StepEvent
+* StepFailedEvent
+* StepFinishedEvent
+* StepStartedEvent
+* TestCaseBrokenEvent
+* TestCaseCanceledEvent
+* TestCaseEvent
+* TestCaseFailedEvent
+* TestCaseFinishedEvent
+* TestCasePendingEvent
+* TestCaseStartedEvent
+* TestCaseStatusChangedEvent
+* TestSuiteEvent
+* TestSuiteFinishedEvent
+* TestSuiteStartedEvent
+
+## Usage examples
+See [allure-phpunit](https://github.com/allure-framework/allure-phpunit) project.

+ 37 - 0
vendor/allure-framework/allure-php-api/composer.json

@@ -0,0 +1,37 @@
+{
+    "name": "allure-framework/allure-php-api",
+    "keywords":["php", "report", "allure", "api"],
+    "description": "PHP API for Allure adapter",
+    "homepage": "http://allure.qatools.ru/",
+    "license": "Apache-2.0",
+    "authors": [
+        {
+            "name": "Ivan Krutov",
+            "email": "vania-pooh@yandex-team.ru",
+            "role": "Developer"
+        }
+    ],
+    "support": {
+        "email": "allure@yandex-team.ru",
+        "source": "https://github.com/allure-framework/allure-php-api"
+    },
+    "require": {
+        "php": ">=5.4.0",
+        "jms/serializer": "^0.16 || ^1.0",
+        "ramsey/uuid": "^3.0",
+        "symfony/http-foundation": "^2.0 || ^3.0 || ^4.0 || ^5.0"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^4.0.0"
+    },
+    "autoload": {
+        "psr-0": {
+            "Yandex": ["src/", "test/"]
+        }
+    },
+    "scripts": {
+        "test": [
+            "phpunit test"
+        ]
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1979 - 0
vendor/allure-framework/allure-php-api/composer.lock


+ 4 - 0
vendor/allure-framework/allure-php-api/phpunit.php

@@ -0,0 +1,4 @@
+<?php
+require_once __DIR__ . '/vendor/autoload.php';
+date_default_timezone_set('UTC');
+ 

+ 24 - 0
vendor/allure-framework/allure-php-api/phpunit.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         beStrictAboutTestsThatDoNotTestAnything="true"
+         bootstrap="phpunit.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false"
+         syntaxCheck="false"
+        >
+    <testsuites>
+        <testsuite name="Allure PHP API Tests">
+            <directory>test/Yandex/Allure/Adapter/</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist>
+            <directory>src/</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 216 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php

@@ -0,0 +1,216 @@
+<?php
+
+namespace Yandex\Allure\Adapter;
+
+use Yandex\Allure\Adapter\Event\ClearStepStorageEvent;
+use Yandex\Allure\Adapter\Event\ClearTestCaseStorageEvent;
+use Yandex\Allure\Adapter\Event\Event;
+use Yandex\Allure\Adapter\Event\StepEvent;
+use Yandex\Allure\Adapter\Event\StepFinishedEvent;
+use Yandex\Allure\Adapter\Event\StepStartedEvent;
+use Yandex\Allure\Adapter\Event\Storage\StepStorage;
+use Yandex\Allure\Adapter\Event\Storage\TestCaseStorage;
+use Yandex\Allure\Adapter\Event\Storage\TestSuiteStorage;
+use Yandex\Allure\Adapter\Event\TestCaseEvent;
+use Yandex\Allure\Adapter\Event\TestCaseFinishedEvent;
+use Yandex\Allure\Adapter\Event\TestCaseStartedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteFinishedEvent;
+use Yandex\Allure\Adapter\Model\Provider;
+use Yandex\Allure\Adapter\Model\Step;
+use Yandex\Allure\Adapter\Model\TestSuite;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class Allure
+{
+    use Utils;
+
+    /**
+     * @var Allure
+     */
+    private static $lifecycle;
+
+    private $stepStorage;
+    private $testCaseStorage;
+    private $testSuiteStorage;
+
+    /**
+     * @var Event
+     */
+    private $lastEvent;
+
+    protected function __construct()
+    {
+        $this->stepStorage = new StepStorage();
+        $this->testCaseStorage = new TestCaseStorage();
+        $this->testSuiteStorage = new TestSuiteStorage();
+    }
+
+    /**
+     * @return Allure
+     */
+    public static function lifecycle()
+    {
+        if (!isset(self::$lifecycle)) {
+            self::setDefaultLifecycle();
+        }
+
+        return self::$lifecycle;
+    }
+
+    public static function setLifecycle(Allure $lifecycle)
+    {
+        self::$lifecycle = $lifecycle;
+    }
+
+    public static function setDefaultLifecycle()
+    {
+        self::$lifecycle = new Allure();
+    }
+
+    public function fire(Event $event)
+    {
+        if ($event instanceof StepStartedEvent) {
+            $this->processStepStartedEvent($event);
+        } elseif ($event instanceof StepFinishedEvent) {
+            $this->processStepFinishedEvent($event);
+        } elseif ($event instanceof TestCaseStartedEvent) {
+            $this->processTestCaseStartedEvent($event);
+        } elseif ($event instanceof TestCaseFinishedEvent) {
+            $this->processTestCaseFinishedEvent($event);
+        } elseif ($event instanceof TestSuiteFinishedEvent) {
+            $this->processTestSuiteFinishedEvent($event);
+        } elseif ($event instanceof TestSuiteEvent) {
+            $this->processTestSuiteEvent($event);
+        } elseif ($event instanceof ClearStepStorageEvent) {
+            $this->processClearStepStorageEvent();
+        } elseif ($event instanceof ClearTestCaseStorageEvent) {
+            $this->processClearTestCaseStorageEvent();
+        } elseif ($event instanceof TestCaseEvent) {
+            $this->processTestCaseEvent($event);
+        } elseif ($event instanceof StepEvent) {
+            $this->processStepEvent($event);
+        } else {
+            throw new AllureException("Unknown event: " . get_class($event));
+        }
+        $this->lastEvent = $event;
+    }
+
+    protected function processStepStartedEvent(StepStartedEvent $event)
+    {
+        $step = new Step();
+        $event->process($step);
+        $this->getStepStorage()->put($step);
+    }
+
+    protected function processStepFinishedEvent(StepFinishedEvent $event)
+    {
+        $step = $this->getStepStorage()->pollLast();
+        $event->process($step);
+        $this->getStepStorage()->getLast()->addStep($step);
+    }
+
+    protected function processStepEvent(StepEvent $event)
+    {
+        $step = $this->getStepStorage()->getLast();
+        $event->process($step);
+    }
+
+    protected function processTestCaseStartedEvent(TestCaseStartedEvent $event)
+    {
+        //init root step if needed
+        $this->getStepStorage()->getLast();
+
+        $testCase = $this->getTestCaseStorage()->get();
+        $event->process($testCase);
+        $this->getTestSuiteStorage()->get($event->getSuiteUuid())->addTestCase($testCase);
+    }
+
+    protected function processTestCaseFinishedEvent(TestCaseFinishedEvent $event)
+    {
+        $testCase = $this->getTestCaseStorage()->get();
+        $event->process($testCase);
+        $rootStep = $this->getStepStorage()->pollLast();
+        foreach ($rootStep->getSteps() as $step) {
+            $testCase->addStep($step);
+        }
+        foreach ($rootStep->getAttachments() as $attachment) {
+            $testCase->addAttachment($attachment);
+        }
+        $this->getTestCaseStorage()->clear();
+    }
+
+    protected function processTestCaseEvent(TestCaseEvent $event)
+    {
+        $testCase = $this->getTestCaseStorage()->get();
+        $event->process($testCase);
+    }
+
+    protected function processTestSuiteEvent(TestSuiteEvent $event)
+    {
+        $uuid = $event->getUuid();
+        $testSuite = $this->getTestSuiteStorage()->get($uuid);
+        $event->process($testSuite);
+    }
+
+    protected function processTestSuiteFinishedEvent(TestSuiteFinishedEvent $event)
+    {
+        $suiteUuid = $event->getUuid();
+        $testSuite = $this->getTestSuiteStorage()->get($suiteUuid);
+        $event->process($testSuite);
+        $this->getTestSuiteStorage()->remove($suiteUuid);
+        $this->saveToFile($suiteUuid, $testSuite);
+    }
+
+    protected function saveToFile($testSuiteUuid, TestSuite $testSuite)
+    {
+        if ($testSuite->size() > 0) {
+            $xml = $testSuite->serialize();
+            $fileName = $testSuiteUuid . '-testsuite.xml';
+            $filePath = Provider::getOutputDirectory() . DIRECTORY_SEPARATOR . $fileName;
+            file_put_contents($filePath, $xml);
+        }
+    }
+
+    protected function processClearStepStorageEvent()
+    {
+        $this->getStepStorage()->clear();
+    }
+
+    protected function processClearTestCaseStorageEvent()
+    {
+        $this->getTestCaseStorage()->clear();
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Event\Storage\StepStorage
+     */
+    public function getStepStorage()
+    {
+        return $this->stepStorage;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Event\Storage\TestCaseStorage
+     */
+    public function getTestCaseStorage()
+    {
+        return $this->testCaseStorage;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Event\Storage\TestSuiteStorage
+     */
+    public function getTestSuiteStorage()
+    {
+        return $this->testSuiteStorage;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Event\Event
+     */
+    public function getLastEvent()
+    {
+        return $this->lastEvent;
+    }
+}

+ 7 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/AllureException.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Yandex\Allure\Adapter;
+
+class AllureException extends \Exception
+{
+}

+ 19 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AllureId.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+
+/**
+ * @Annotation
+ * @Target({"METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class AllureId
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+}

+ 185 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationManager.php

@@ -0,0 +1,185 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Yandex\Allure\Adapter\Event\TestCaseStartedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteStartedEvent;
+use Yandex\Allure\Adapter\Model;
+use Yandex\Allure\Adapter\Model\ConstantChecker;
+
+class AnnotationManager
+{
+    /**
+     * @var string
+     */
+    private $title;
+
+    /**
+     * @var Model\Description
+     */
+    private $description;
+
+    /**
+     * @var array
+     */
+    private $labels;
+
+    /**
+     * @var array
+     */
+    private $parameters;
+
+    public function __construct(array $annotations)
+    {
+        $this->labels = [];
+        $this->parameters = [];
+        $this->processAnnotations($annotations);
+    }
+
+    private function processAnnotations(array $annotations)
+    {
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof AllureId) {
+                $this->labels[] = Model\Label::id($annotation->value);
+            } elseif ($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 TestCaseId) {
+                foreach ($annotation->getTestCaseIds() as $testCaseId) {
+                    $this->labels[] = Model\Label::testId($testCaseId);
+                }
+            } elseif ($annotation instanceof Severity) {
+                $this->labels[] = Model\Label::severity(
+                    ConstantChecker::validate('Yandex\Allure\Adapter\Model\SeverityLevel', $annotation->level)
+                );
+            } elseif ($annotation instanceof TestType) {
+                $this->labels[] = Model\Label::testType($annotation->type);
+            } elseif ($annotation instanceof Parameter) {
+                $this->parameters[] = new Model\Parameter(
+                    $annotation->name,
+                    $annotation->value,
+                    $annotation->kind
+                );
+            } elseif ($annotation instanceof Parameters) {
+                foreach ($annotation->parameters as $parameter) {
+                    $this->parameters[] = new Model\Parameter(
+                        $parameter->name,
+                        $parameter->value,
+                        $parameter->kind
+                    );
+                }
+            } elseif ($annotation instanceof Label) {
+                $this->labels[] = Model\Label::label($annotation->name, $annotation->value);
+            } elseif ($annotation instanceof Labels) {
+                foreach ($annotation -> labels as $label) {
+                    $this->labels[] = Model\Label::label($label->name, $label->value);
+                }
+            }
+        }
+    }
+
+    public function updateTestSuiteEvent(TestSuiteStartedEvent $event)
+    {
+
+        if ($this->isTitlePresent()) {
+            $event->setTitle($this->getTitle());
+        }
+
+        if ($this->isDescriptionPresent()) {
+            $event->setDescription($this->getDescription());
+        }
+
+        if ($this->areLabelsPresent()) {
+            $event->setLabels($this->getLabels());
+        }
+
+    }
+
+    public function updateTestCaseEvent(TestCaseStartedEvent $event)
+    {
+        if ($this->isTitlePresent()) {
+            $event->setTitle($this->getTitle());
+        }
+
+        if ($this->isDescriptionPresent()) {
+            $event->setDescription($this->getDescription());
+        }
+
+        if ($this->areLabelsPresent()) {
+            $event->setLabels(array_merge($event->getLabels(), $this->getLabels()));
+        }
+
+        if ($this->areParametersPresent()) {
+            $event->setParameters($this->getParameters());
+        }
+
+    }
+
+    /**
+     * @return Model\Description
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * @return array
+     */
+    public function getLabels()
+    {
+        return $this->labels;
+    }
+
+    /**
+     * @return array
+     */
+    public function getParameters()
+    {
+        return $this->parameters;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    public function isTitlePresent()
+    {
+        return isset($this->title);
+    }
+
+    public function isDescriptionPresent()
+    {
+        return isset($this->description);
+    }
+
+    public function areLabelsPresent()
+    {
+        return !empty($this->labels);
+    }
+
+    public function areParametersPresent()
+    {
+        return !empty($this->parameters);
+    }
+}

+ 107 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationProvider.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Annotations\AnnotationRegistry;
+use Doctrine\Common\Annotations\IndexedReader;
+
+class AnnotationProvider
+{
+    /**
+     * @var AnnotationReader
+     */
+    private static $annotationReader;
+
+    /**
+     * @var IndexedReader
+     */
+    private static $indexedReader;
+
+    /**
+     * Returns a list of class annotations
+     * @param $instance
+     * @return array
+     */
+    public static function getClassAnnotations($instance)
+    {
+        $ref = new \ReflectionClass($instance);
+
+        return self::getIndexedReader()->getClassAnnotations($ref);
+    }
+
+    /**
+     * Returns a list of method annotations
+     * @param $instance
+     * @param $methodName
+     * @return array
+     */
+    public static function getMethodAnnotations($instance, $methodName)
+    {
+        $ref = new \ReflectionMethod($instance, $methodName);
+
+        return self::getIndexedReader()->getMethodAnnotations($ref);
+    }
+
+    /**
+     * @return IndexedReader
+     */
+    private static function getIndexedReader()
+    {
+        if (!isset(self::$indexedReader)) {
+            self::registerAnnotationNamespaces();
+            self::$indexedReader = new IndexedReader(self::getAnnotationReader());
+        }
+
+        return self::$indexedReader;
+    }
+
+    /**
+     * @return AnnotationReader
+     */
+    private static function getAnnotationReader()
+    {
+        if (!isset(self::$annotationReader)) {
+            self::registerAnnotationNamespaces();
+            self::$annotationReader = new AnnotationReader();
+        }
+
+        return self::$annotationReader;
+    }
+
+    public static function registerAnnotationNamespaces()
+    {
+        AnnotationRegistry::registerAutoloadNamespace(
+            'JMS\Serializer\Annotation',
+            [
+                __DIR__ . "/../../../../../../../../vendor/jms/serializer/src",
+                __DIR__ . "/../../../../vendor/jms/serializer/src"
+            ]
+        );
+
+        AnnotationRegistry::registerAutoloadNamespace(
+            'Yandex\Allure\Adapter\Annotation',
+            __DIR__ . "/../../../../../src"
+        );
+    }
+
+    /**
+     * Allows to ignore framework-specific annotations
+     * @param array $annotations
+     */
+    public static function addIgnoredAnnotations(array $annotations)
+    {
+        foreach ($annotations as $annotation) {
+            self::getAnnotationReader()->addGlobalIgnoredName($annotation);
+        }
+    }
+
+    /**
+     * Remove the singleton instances. Useful in unit-testing.
+     */
+    public static function tearDown()
+    {
+        static::$indexedReader = null;
+        static::$annotationReader = null;
+    }
+}

+ 25 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Description.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+use Yandex\Allure\Adapter\Model\DescriptionType;
+
+/**
+ * @Annotation
+ * @Target({"CLASS", "METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Description
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+
+    /**
+     * @var string
+     */
+    public $type = DescriptionType::TEXT;
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Features.php

@@ -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 Features
+{
+    /**
+     * @var array
+     * @Required
+     */
+    public $featureNames;
+
+    /**
+     * @return array
+     */
+    public function getFeatureNames()
+    {
+        return $this->featureNames;
+    }
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Issues.php

@@ -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 Issues
+{
+    /**
+     * @var array
+     * @Required
+     */
+    public $issueKeys;
+
+    /**
+     * @return array
+     */
+    public function getIssueKeys()
+    {
+        return $this->issueKeys;
+    }
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Label.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+
+/**
+ * @Annotation
+ * @Target({"METHOD", "ANNOTATION"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Label
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $name;
+
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+
+}

+ 17 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Labels.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Labels
+{
+    /**
+     * @var array<Yandex\Allure\Adapter\Annotation\Label>
+     * @Required
+     */
+    public $labels;
+}

+ 31 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Parameter.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+
+/**
+ * @Annotation
+ * @Target({"METHOD", "ANNOTATION"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Parameter
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $name;
+
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+
+    /**
+     * @var string
+     */
+    public $kind = ParameterKind::ARGUMENT;
+}

+ 19 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Parameters.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+
+/**
+ * @Annotation
+ * @Target({"METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Parameters
+{
+    /**
+     * @var array<Yandex\Allure\Adapter\Annotation\Parameter>
+     * @Required
+     */
+    public $parameters;
+}

+ 18 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Severity.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Yandex\Allure\Adapter\Model\SeverityLevel;
+
+/**
+ * @Annotation
+ * @Target({"METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Severity
+{
+    /**
+     * @var string
+     */
+    public $level = SeverityLevel::NORMAL;
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Stories.php

@@ -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 Stories
+{
+    /**
+     * @var array
+     * @Required
+     */
+    public $stories;
+
+    /**
+     * @return array
+     */
+    public function getStories()
+    {
+        return $this->stories;
+    }
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/TestCaseId.php

@@ -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 TestCaseId
+{
+    /**
+     * @var array
+     * @Required
+     */
+    public $testCaseIds;
+
+    /**
+     * @return array
+     */
+    public function getTestCaseIds()
+    {
+        return $this->testCaseIds;
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/TestType.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class TestType
+{
+    /**
+     * @var string
+     */
+    public $type = "screenshotDiff";
+}

+ 19 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/Title.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\Annotation\Required;
+
+/**
+ * @Annotation
+ * @Target({"CLASS", "METHOD"})
+ * @package Yandex\Allure\Adapter\Annotation
+ */
+class Title
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+}

+ 136 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddAttachmentEvent.php

@@ -0,0 +1,136 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
+use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
+use Yandex\Allure\Adapter\AllureException;
+use Yandex\Allure\Adapter\Model\Attachment;
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Provider;
+use Yandex\Allure\Adapter\Model\Step;
+use Yandex\Allure\Adapter\Support\Utils;
+
+const DEFAULT_FILE_EXTENSION = 'txt';
+const DEFAULT_MIME_TYPE = 'text/plain';
+
+class AddAttachmentEvent implements StepEvent
+{
+    private $filePathOrContents;
+
+    private $caption;
+
+    private $type;
+
+    public function __construct($filePathOrContents, $caption, $type = null)
+    {
+        $this->filePathOrContents = $filePathOrContents;
+        $this->caption = $caption;
+        $this->type = $type;
+    }
+
+    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 getAttachmentFileName($filePathOrContents, $type)
+    {
+        $filePath = $filePathOrContents;
+        if (!file_exists($filePath) || !is_file($filePath)) {
+            //Save contents to temporary file
+            $filePath = tempnam(sys_get_temp_dir(), 'allure-attachment');
+            if (!file_put_contents($filePath, $filePathOrContents)) {
+                throw new AllureException("Failed to save attachment contents to $filePath");
+            }
+        }
+
+        if (!isset($type)) {
+            $type = $this->guessFileMimeType($filePath);
+            $this->type = $type;
+        }
+
+        $fileExtension = $this->guessFileExtension($type);
+
+        $fileSha1 = sha1_file($filePath);
+        $outputPath = $this->getOutputPath($fileSha1, $fileExtension);
+        if (!copy($filePath, $outputPath)) {
+            throw new AllureException("Failed to copy attachment from $filePath to $outputPath.");
+        }
+
+        return $this->getOutputFileName($fileSha1, $fileExtension);
+    }
+
+    private function guessFileMimeType($filePath)
+    {
+        $mimeTypesClass = '\Symfony\Component\Mime\MimeTypes';
+        if (class_exists($mimeTypesClass)) {
+            /** @var \Symfony\Component\Mime\MimeTypes $mimeTypes */
+            $mimeTypes = call_user_func([$mimeTypesClass, 'getDefault']);
+            $type = $mimeTypes->guessMimeType($filePath);
+        } else {
+            $type = MimeTypeGuesser::getInstance()->guess($filePath);
+        }
+        if (!isset($type)) {
+            return DEFAULT_MIME_TYPE;
+        }
+
+        return $type;
+    }
+
+    private function guessFileExtension($mimeType)
+    {
+        $mimeTypesClass = '\Symfony\Component\Mime\MimeTypes';
+        if (class_exists($mimeTypesClass)) {
+            /** @var \Symfony\Component\Mime\MimeTypes $mimeTypes */
+            $mimeTypes = call_user_func([$mimeTypesClass, 'getDefault']);
+            $extensions = $mimeTypes->getExtensions($mimeType);
+            $candidate = isset($extensions[0]) ? $extensions[0] : null;
+        } else {
+            $candidate = ExtensionGuesser::getInstance()->guess($mimeType);
+        }
+        if (!isset($candidate)) {
+            return DEFAULT_FILE_EXTENSION;
+        }
+
+        return $candidate;
+    }
+
+    public function getOutputFileName($sha1, $extension)
+    {
+        return $sha1 . '-attachment.' . $extension;
+    }
+
+    public function getOutputPath($sha1, $extension)
+    {
+        return Provider::getOutputDirectory() . DIRECTORY_SEPARATOR . $this->getOutputFileName($sha1, $extension);
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getCaption()
+    {
+        return $this->caption;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getFilePathOrContents()
+    {
+        return $this->filePathOrContents;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+}

+ 29 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddParameterEvent.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Parameter;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+use Yandex\Allure\Adapter\Model\TestCase;
+
+class AddParameterEvent implements TestCaseEvent
+{
+    private $name;
+    private $value;
+    private $kind;
+
+    public function __construct($name, $value, $kind = ParameterKind::SYSTEM_PROPERTY)
+    {
+        $this->name = $name;
+        $this->value = $value;
+        $this->kind = $kind;
+    }
+
+    public function process(Entity $context)
+    {
+        if ($context instanceof TestCase) {
+            $context->addParameter(new Parameter($this->name, $this->value, $this->kind));
+        }
+    }
+}

+ 12 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/ClearStepStorageEvent.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+
+class ClearStepStorageEvent implements StepEvent
+{
+    public function process(Entity $context)
+    {
+    }
+}

+ 12 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/ClearTestCaseStorageEvent.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+
+class ClearTestCaseStorageEvent implements TestCaseEvent
+{
+    public function process(Entity $context)
+    {
+    }
+}

+ 10 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Event.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+
+interface Event
+{
+    public function process(Entity $context);
+}

+ 34 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/RemoveAttachmentsEvent.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Attachment;
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Step;
+
+class RemoveAttachmentsEvent implements StepEvent
+{
+    private $pattern;
+
+    public function __construct($pattern)
+    {
+        $this->pattern = $pattern;
+    }
+
+    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);
+                    }
+                }
+            }
+        }
+    }
+}

+ 17 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepCanceledEvent.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\Step;
+
+class StepCanceledEvent implements StepEvent
+{
+    public function process(Entity $context)
+    {
+        if ($context instanceof Step) {
+            $context->setStatus(Status::CANCELED);
+        }
+    }
+}

+ 7 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepEvent.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+interface StepEvent extends Event
+{
+}

+ 17 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepFailedEvent.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\Step;
+
+class StepFailedEvent implements StepEvent
+{
+    public function process(Entity $context)
+    {
+        if ($context instanceof Step) {
+            $context->setStatus(Status::FAILED);
+        }
+    }
+}

+ 19 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepFinishedEvent.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Step;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class StepFinishedEvent implements StepEvent
+{
+    use Utils;
+
+    public function process(Entity $context)
+    {
+        if ($context instanceof Step) {
+            $context->setStop(self::getTimestamp());
+        }
+    }
+}

+ 39 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/StepStartedEvent.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\Step;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class StepStartedEvent implements StepEvent
+{
+    use Utils;
+
+    private $name;
+
+    private $title;
+
+    public function __construct($name)
+    {
+        $this->name = $name;
+    }
+
+    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 withTitle($title)
+    {
+        $this->title = $title;
+
+        return $this;
+    }
+}

+ 96 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/StepStorage.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\Step;
+use \SplStack;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class StepStorage
+{
+    use Utils;
+
+    const ROOT_STEP_NAME = 'root-step';
+
+    /**
+     * @var SplStack
+     */
+    private $storage;
+
+    public function __construct()
+    {
+        $this->storage = new SplStack();
+    }
+
+    /**
+     * @return Step
+     */
+    public function getLast()
+    {
+        if ($this->storage->isEmpty()) {
+            $this->put($this->getRootStep());
+        }
+
+        return $this->storage->top();
+    }
+
+    /**
+     * @return Step
+     */
+    public function pollLast()
+    {
+        $step = $this->storage->pop();
+        if ($this->storage->isEmpty()) {
+            $this->storage->push($this->getRootStep());
+        }
+
+        return $step;
+    }
+
+    /**
+     * @param Step $step
+     */
+    public function put(Step $step)
+    {
+        $this->storage->push($step);
+    }
+
+    public function clear()
+    {
+        $this->storage = new SplStack();
+        $this->put($this->getRootStep());
+    }
+
+    public function isEmpty()
+    {
+        return ($this->size() === 0) && $this->isRootStep($this->getLast());
+    }
+
+    public function size()
+    {
+        return $this->storage->count() - 1;
+    }
+
+    public function isRootStep(Step $step)
+    {
+        return $step->getName() === self::ROOT_STEP_NAME;
+    }
+
+    /**
+     * @return Step
+     */
+    protected function getRootStep()
+    {
+        $step = new Step();
+        $step->setName(self::ROOT_STEP_NAME);
+        $step->setTitle(
+            "If you're seeing this then there's an error in step processing. "
+            . "Please send feedback to allure@yandex-team.ru. Thank you."
+        );
+        $step->setStart(self::getTimestamp());
+        $step->setStatus(Status::BROKEN);
+
+        return $step;
+    }
+}

+ 43 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/TestCaseStorage.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+use Yandex\Allure\Adapter\Model\TestCase;
+
+class TestCaseStorage
+{
+    /**
+     * @var TestCase
+     */
+    private $case;
+
+    /**
+     * @return TestCase
+     */
+    public function get()
+    {
+        if (!isset($this->case)) {
+            $this->case = new TestCase();
+        }
+
+        return $this->case;
+    }
+
+    /**
+     * @param TestCase $case
+     */
+    public function put(TestCase $case)
+    {
+        $this->case = $case;
+    }
+
+    public function clear()
+    {
+        unset($this->case);
+    }
+
+    public function isEmpty()
+    {
+        return !isset($this->case);
+    }
+}

+ 53 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/Storage/TestSuiteStorage.php

@@ -0,0 +1,53 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+use Yandex\Allure\Adapter\Model\TestSuite;
+
+class TestSuiteStorage
+{
+    /**
+     * @var array
+     */
+    private $storage;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    /**
+     * @param string $uuid
+     * @return TestSuite
+     */
+    public function get($uuid)
+    {
+        if (!array_key_exists($uuid, $this->storage)) {
+            $this->storage[$uuid] = new TestSuite();
+        }
+
+        return $this->storage[$uuid];
+    }
+
+    public function remove($uuid)
+    {
+        if (array_key_exists($uuid, $this->storage)) {
+            unset($this->storage[$uuid]);
+        }
+    }
+
+    public function clear()
+    {
+        $this->storage = [];
+    }
+
+    public function isEmpty()
+    {
+        return $this->size() === 0;
+    }
+
+    public function size()
+    {
+        return sizeof($this->storage);
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseBrokenEvent.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseBrokenEvent extends TestCaseStatusChangedEvent
+{
+    /**
+     * @return string
+     */
+    protected function getStatus()
+    {
+        return Status::BROKEN;
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseCanceledEvent.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseCanceledEvent extends TestCaseStatusChangedEvent
+{
+    /**
+     * @return string
+     */
+    protected function getStatus()
+    {
+        return Status::CANCELED;
+    }
+}

+ 7 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseEvent.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+interface TestCaseEvent extends Event
+{
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseFailedEvent.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseFailedEvent extends TestCaseStatusChangedEvent
+{
+    /**
+     * @return string
+     */
+    protected function getStatus()
+    {
+        return Status::FAILED;
+    }
+}

+ 19 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseFinishedEvent.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\TestCase;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class TestCaseFinishedEvent implements TestCaseEvent
+{
+    use Utils;
+
+    public function process(Entity $context)
+    {
+        if ($context instanceof TestCase) {
+            $context->setStop(self::getTimestamp());
+        }
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCasePendingEvent.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCasePendingEvent extends TestCaseStatusChangedEvent
+{
+    /**
+     * @return string
+     */
+    protected function getStatus()
+    {
+        return Status::PENDING;
+    }
+}

+ 196 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseStartedEvent.php

@@ -0,0 +1,196 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Description;
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\TestCase;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class TestCaseStartedEvent implements TestCaseEvent
+{
+    use Utils;
+
+    /**
+     * @var string
+     */
+    private $suiteUuid;
+
+    /**
+     * @var string
+     */
+    private $name;
+
+    /**
+     * @var string
+     */
+    private $title;
+
+    /**
+     * @var Description
+     */
+    private $description;
+
+    /**
+     * @var array
+     */
+    private $labels;
+
+    /**
+     * @var array
+     */
+    private $parameters;
+
+    public function __construct($suiteUuid, $name)
+    {
+        $this->suiteUuid = $suiteUuid;
+        $this->name = $name;
+        $this->labels = [];
+        $this->parameters = [];
+    }
+
+    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);
+            }
+        }
+    }
+
+    /**
+     * @param string $title
+     * @return $this
+     */
+    public function withTitle($title)
+    {
+        $this->setTitle($title);
+
+        return $this;
+    }
+
+    /**
+     * @param Description $description
+     * @return $this
+     */
+    public function withDescription(Description $description)
+    {
+        $this->setDescription($description);
+
+        return $this;
+    }
+
+    /**
+     * @param array $labels
+     * @return $this
+     */
+    public function withLabels(array $labels)
+    {
+        $this->setLabels($labels);
+
+        return $this;
+    }
+
+    /**
+     * @param array $parameters
+     * @return $this
+     */
+    public function withParameters(array $parameters)
+    {
+        $this->setParameters($parameters);
+
+        return $this;
+    }
+
+    /**
+     * @return string
+     */
+    public function getSuiteUuid()
+    {
+        return $this->suiteUuid;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Description $description
+     */
+    public function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    /**
+     * @param array $labels
+     */
+    public function setLabels(array $labels)
+    {
+        $this->labels = $labels;
+    }
+
+    /**
+     * @param string $title
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    /**
+     * @param array $parameters
+     */
+    public function setParameters($parameters)
+    {
+        $this->parameters = $parameters;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Model\Description
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * @return array
+     */
+    public function getLabels()
+    {
+        return $this->labels;
+    }
+
+    /**
+     * @return array
+     */
+    public function getParameters()
+    {
+        return $this->parameters;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+}

+ 60 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestCaseStatusChangedEvent.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\Failure;
+use Yandex\Allure\Adapter\Model\TestCase;
+
+abstract class TestCaseStatusChangedEvent implements TestCaseEvent
+{
+    /**
+     * @var \Exception
+     */
+    private $exception;
+
+    /**
+     * @var string
+     */
+    private $message;
+
+    /**
+     * @return string
+     */
+    abstract protected function getStatus();
+
+    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);
+            }
+        }
+    }
+
+    /**
+     * @param string $message
+     * @return $this
+     */
+    public function withMessage($message)
+    {
+        $this->message = $message;
+
+        return $this;
+    }
+
+    /**
+     * @param \Exception $exception
+     * @return $this
+     */
+    public function withException($exception)
+    {
+        $this->exception = $exception;
+
+        return $this;
+    }
+}

+ 11 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteEvent.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+interface TestSuiteEvent extends Event
+{
+    /**
+     * @return string
+     */
+    public function getUuid();
+}

+ 34 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteFinishedEvent.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\TestSuite;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class TestSuiteFinishedEvent implements TestSuiteEvent
+{
+    use Utils;
+
+    /**
+     * @var string
+     */
+    private $uuid;
+
+    public function __construct($uuid)
+    {
+        $this->uuid = $uuid;
+    }
+
+    public function process(Entity $context)
+    {
+        if ($context instanceof TestSuite) {
+            $context->setStop(self::getTimestamp());
+        }
+    }
+
+    public function getUuid()
+    {
+        return $this->uuid;
+    }
+}

+ 166 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/TestSuiteStartedEvent.php

@@ -0,0 +1,166 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Description;
+use Yandex\Allure\Adapter\Model\Entity;
+use Yandex\Allure\Adapter\Model\TestSuite;
+use Yandex\Allure\Adapter\Support\Utils;
+
+class TestSuiteStartedEvent implements TestSuiteEvent
+{
+    use Utils;
+
+    /**
+     * @var string
+     */
+    private $name;
+
+    /**
+     * @var string
+     */
+    private $title;
+
+    /**
+     * @var Description
+     */
+    private $description;
+
+    /**
+     * @var array
+     */
+    private $labels;
+
+    /**
+     * @var string
+     */
+    private $uuid;
+
+    public function __construct($name)
+    {
+        $this->name = $name;
+        $this->labels = [];
+    }
+
+    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);
+            }
+        }
+    }
+
+    /**
+     * @param string $title
+     * @return $this
+     */
+    public function withTitle($title)
+    {
+        $this->setTitle($title);
+
+        return $this;
+    }
+
+    /**
+     * @param Description $description
+     * @return $this
+     */
+    public function withDescription(Description $description)
+    {
+        $this->setDescription($description);
+
+        return $this;
+    }
+
+    /**
+     * @param array $labels
+     * @return $this
+     */
+    public function withLabels(array $labels)
+    {
+        $this->setLabels($labels);
+
+        return $this;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Description $description
+     */
+    public function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    /**
+     * @param array $labels
+     */
+    public function setLabels($labels)
+    {
+        $this->labels = $labels;
+    }
+
+    /**
+     * @param string $name
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * @param string $title
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Model\Description
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * @return array
+     */
+    public function getLabels()
+    {
+        return $this->labels;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    public function getUuid()
+    {
+        if (!isset($this->uuid)) {
+            $this->uuid = self::generateUUID();
+        }
+
+        return $this->uuid;
+    }
+}

+ 65 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Attachment.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ */
+class Attachment implements Entity
+{
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $title;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $source;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $type;
+
+    public function __construct($title, $source, $type)
+    {
+        $this->source = $source;
+        $this->title = $title;
+        $this->type = $type;
+    }
+
+    /**
+     * @return string
+     */
+    public function getSource()
+    {
+        return $this->source;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+}

+ 33 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/ConstantChecker.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use Yandex\Allure\Adapter\AllureException;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ */
+class ConstantChecker
+{
+
+    /**
+     * Checks whether constant with the specified value is present. If it's present it's returned. An
+     * exception is thrown otherwise.
+     * @param $className
+     * @param $value
+     * @throws AllureException
+     * @return
+     */
+    public static function validate($className, $value)
+    {
+        $ref = new \ReflectionClass($className);
+        foreach ($ref->getConstants() as $constantValue) {
+            if ($constantValue === $value) {
+                return $value;
+            }
+        }
+        throw new AllureException(
+            "Value \"$value\" is not present in class $className. You should use a constant from this class."
+        );
+    }
+}

+ 50 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Description.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlValue;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ * @XmlRoot("description")
+ */
+class Description implements Entity
+{
+
+    /**
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $type;
+
+    /**
+     * @Type("string")
+     * @XmlValue
+     */
+    private $value;
+
+    public function __construct($type, $value)
+    {
+        $this->type = ConstantChecker::validate('Yandex\Allure\Adapter\Model\DescriptionType', $type);
+        $this->value = $value;
+    }
+
+    /**
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+}

+ 14 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/DescriptionType.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+/**
+ * Description type
+ * @package Yandex\Allure\Adapter\Model
+ */
+final class DescriptionType
+{
+    const TEXT = 'text';
+    const HTML = 'html';
+    const MARKDOWN = 'markdown';
+}

+ 11 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Entity.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+/**
+ * Marker interface
+ * @package Yandex\Allure\Adapter\Model
+ */
+interface Entity
+{
+}

+ 54 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Failure.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlElement;
+
+class Failure implements Entity
+{
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $message;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     * @SerializedName("stack-trace")
+     */
+    private $stackTrace;
+
+    public function __construct($message)
+    {
+        $this->message = $message;
+    }
+
+    /**
+     * @return string
+     */
+    public function getMessage()
+    {
+        return $this->message;
+    }
+
+    /**
+     * @return string
+     */
+    public function getStackTrace()
+    {
+        return $this->stackTrace;
+    }
+
+    /**
+     * @param string $stackTrace
+     */
+    public function setStackTrace($stackTrace)
+    {
+        $this->stackTrace = $stackTrace;
+    }
+}

+ 125 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Label.php

@@ -0,0 +1,125 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlRoot;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ * @XmlRoot("label")
+ */
+class Label implements Entity
+{
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $name;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $value;
+
+    public function __construct($name, $value)
+    {
+        $this->name = $name;
+        $this->value = $value;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * @param $id
+     * @return Label
+     */
+    public static function id($id)
+    {
+        return new Label(LabelType::ID, $id);
+    }
+    /**
+     * @param $featureName
+     * @return Label
+     */
+    public static function feature($featureName)
+    {
+        return new Label(LabelType::FEATURE, $featureName);
+    }
+
+    /**
+     * @param $storyName
+     * @return Label
+     */
+    public static function story($storyName)
+    {
+        return new Label(LabelType::STORY, $storyName);
+    }
+
+    /**
+     * @param $severityLevel
+     * @return Label
+     */
+    public static function severity($severityLevel)
+    {
+        return new Label(LabelType::SEVERITY, $severityLevel);
+    }
+
+    /**
+     * @param $testType
+     * @return Label
+     */
+    public static function testType($testType)
+    {
+        return new Label(LabelType::TEST_TYPE, $testType);
+    }
+
+    /**
+     * @param $issueKey
+     * @return Label
+     */
+    public static function issue($issueKey)
+    {
+        return new Label(LabelType::ISSUE, $issueKey);
+    }
+
+    /**
+     * @param $testCaseId
+     *
+     * @return Label
+     */
+    public static function testId($testCaseId)
+    {
+        return new Label(LabelType::TEST_ID, $testCaseId);
+    }
+
+    /**
+     * @param $name
+     * @param $value
+     *
+     * @return Label
+     */
+    public static function label($name, $value)
+    {
+        return new Label($name, $value);
+    }
+}

+ 14 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/LabelType.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+class LabelType
+{
+    const ID = 'AS_ID';
+    const FEATURE = 'feature';
+    const STORY = 'story';
+    const SEVERITY = 'severity';
+    const ISSUE = 'issue';
+    const TEST_ID = 'testId';
+    const TEST_TYPE = 'testType';
+}

+ 62 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Parameter.php

@@ -0,0 +1,62 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+
+class Parameter implements Entity
+{
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $name;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $value;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $kind;
+
+    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;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKind()
+    {
+        return $this->kind;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+}

+ 14 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/ParameterKind.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+/**
+ * Parameter kind
+ * @package Yandex\Allure\Adapter\Model
+ */
+final class ParameterKind
+{
+    const ARGUMENT = 'argument';
+    const SYSTEM_PROPERTY = 'system-property';
+    const ENVIRONMENT_VARIABLE = 'environment-variable';
+}

+ 28 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Provider.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+class Provider
+{
+
+    /**
+     * @var string
+     */
+    private static $outputDirectory;
+
+    /**
+     * @param string $outputDirectory
+     */
+    public static function setOutputDirectory($outputDirectory)
+    {
+        self::$outputDirectory = $outputDirectory;
+    }
+
+    /**
+     * @return string
+     */
+    public static function getOutputDirectory()
+    {
+        return self::$outputDirectory;
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/SeverityLevel.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+/**
+ * Severity level
+ * @package Yandex\Allure\Adapter\Model
+ */
+final class SeverityLevel
+{
+    const BLOCKER = 'blocker';
+    const CRITICAL = 'critical';
+    const NORMAL = 'normal';
+    const MINOR = 'minor';
+    const TRIVIAL = 'trivial';
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Status.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+/**
+ * Step status
+ * @package Yandex\Allure\Adapter\Model
+ */
+final class Status
+{
+    const FAILED = 'failed';
+    const BROKEN = 'broken';
+    const PASSED = 'passed';
+    const CANCELED = 'canceled';
+    const PENDING = 'pending';
+}

+ 189 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/Step.php

@@ -0,0 +1,189 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlElement;
+
+class Step implements Entity
+{
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $start;
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $stop;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $name;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $title;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Step>")
+     * @XmlList(entry = "step")
+     */
+    private $steps;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Attachment>")
+     * @XmlList(entry = "attachment")
+     */
+    private $attachments;
+
+    /**
+     * @var Status
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $status;
+
+    public function __construct()
+    {
+        $this->steps = [];
+        $this->attachments = [];
+    }
+
+    /**
+     * @param string $name
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * @param int $start
+     */
+    public function setStart($start)
+    {
+        $this->start = $start;
+    }
+
+    /**
+     * @param int $stop
+     */
+    public function setStop($stop)
+    {
+        $this->stop = $stop;
+    }
+
+    /**
+     * @param string $status
+     */
+    public function setStatus($status)
+    {
+        $this->status = ConstantChecker::validate('Yandex\Allure\Adapter\Model\Status', $status);
+    }
+
+    /**
+     * @return array
+     */
+    public function getAttachments()
+    {
+        return $this->attachments;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * @return array
+     */
+    public function getSteps()
+    {
+        return $this->steps;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStop()
+    {
+        return $this->stop;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * @return string
+     */
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    /**
+     * @param string $title
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Step $step
+     */
+    public function addStep(Step $step)
+    {
+        $this->steps[] = $step;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Attachment $attachment
+     */
+    public function addAttachment(Attachment $attachment)
+    {
+        $this->attachments[] = $attachment;
+    }
+
+    /**
+     * @param $index
+     */
+    public function removeAttachment($index)
+    {
+        if (isset($this->attachments[$index])) {
+            unset($this->attachments[$index]);
+        }
+    }
+}

+ 275 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/TestCase.php

@@ -0,0 +1,275 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlRoot;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ * @XmlRoot("test-case")
+ */
+class TestCase implements Entity
+{
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $start;
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $stop;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $status = Status::PASSED;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $name;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $title;
+
+    /**
+     * @var Description
+     * @Type("Yandex\Allure\Adapter\Model\Description")
+     */
+    private $description;
+
+    /**
+     * @var Failure
+     * @Type("Yandex\Allure\Adapter\Model\Failure")
+     */
+    private $failure;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Step>")
+     * @XmlList(entry = "step")
+     */
+    private $steps;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Attachment>")
+     * @XmlList(entry = "attachment")
+     */
+    private $attachments;
+
+    /**
+     * @Type("array<Yandex\Allure\Adapter\Model\Label>")
+     * @XmlList(entry = "label")
+     */
+    private $labels;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Parameter>")
+     * @XmlList(entry = "parameter")
+     */
+    private $parameters;
+
+    public function __construct()
+    {
+        $this->steps = [];
+        $this->labels = [];
+        $this->attachments = [];
+        $this->parameters = [];
+    }
+
+    /**
+     * @return array
+     */
+    public function getAttachments()
+    {
+        return $this->attachments;
+    }
+
+    /**
+     * @return array
+     */
+    public function getLabels()
+    {
+        return $this->labels;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return array
+     */
+    public function getSteps()
+    {
+        return $this->steps;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStop()
+    {
+        return $this->stop;
+    }
+
+    /**
+     * @return string
+     */
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Model\Description
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * @return \Yandex\Allure\Adapter\Model\Failure
+     */
+    public function getFailure()
+    {
+        return $this->failure;
+    }
+
+    /**
+     * @return array
+     */
+    public function getParameters()
+    {
+        return $this->parameters;
+    }
+
+    /**
+     * @param string $name
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * @param int $start
+     */
+    public function setStart($start)
+    {
+        $this->start = $start;
+    }
+
+    /**
+     * @param int $stop
+     */
+    public function setStop($stop)
+    {
+        $this->stop = $stop;
+    }
+
+    /**
+     * @param string $status
+     */
+    public function setStatus($status)
+    {
+        $this->status = ConstantChecker::validate('Yandex\Allure\Adapter\Model\Status', $status);
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Description $description
+     */
+    public function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Failure $failure
+     */
+    public function setFailure($failure)
+    {
+        $this->failure = $failure;
+    }
+
+    /**
+     * @param string $title
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Label $label
+     */
+    public function addLabel(Label $label)
+    {
+        $this->labels[] = $label;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Step $step
+     */
+    public function addStep(Step $step)
+    {
+        $this->steps[] = $step;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Attachment $attachment
+     */
+    public function addAttachment(Attachment $attachment)
+    {
+        $this->attachments[] = $attachment;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Parameter $parameter
+     */
+    public function addParameter(Parameter $parameter)
+    {
+        $this->parameters[] = $parameter;
+    }
+}

+ 271 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Model/TestSuite.php

@@ -0,0 +1,271 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Model;
+
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Serializer;
+use JMS\Serializer\SerializerBuilder;
+use JMS\Serializer\Annotation\Exclude;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlRoot;
+
+/**
+ * @package Yandex\Allure\Adapter\Model
+ * @XmlNamespace(uri="urn:model.allure.qatools.yandex.ru", prefix="alr")
+ * @XmlRoot(name="alr:test-suite")
+ * @ExclusionPolicy("none")
+ */
+class TestSuite implements \Serializable, Entity
+{
+
+    const DEFAULT_VERSION = '1.4.0';
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $start;
+
+    /**
+     * @var int
+     * @Type("integer")
+     * @XmlAttribute
+     */
+    private $stop;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlAttribute
+     */
+    private $version;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $name;
+
+    /**
+     * @var string
+     * @Type("string")
+     * @XmlElement(cdata=false)
+     */
+    private $title;
+
+    /**
+     * @var Description
+     * @Type("Yandex\Allure\Adapter\Model\Description")
+     */
+    private $description;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\TestCase>")
+     * @XmlList(entry = "test-case")
+     * @SerializedName("test-cases")
+     */
+    private $testCases;
+
+    /**
+     * @var array
+     * @Type("array<Yandex\Allure\Adapter\Model\Label>")
+     * @XmlList(entry = "label")
+     */
+    private $labels;
+
+    /**
+     * @var Serializer
+     * @Exclude
+     */
+    private $serializer;
+
+    /**
+     * @var TestCase
+     * @Type("Yandex\Allure\Adapter\Model\TestCase")
+     * @Exclude
+     */
+    private $currentTestCase;
+
+    public function __construct()
+    {
+        $this->testCases = [];
+        $this->labels = [];
+        $this->version = self::DEFAULT_VERSION;
+    }
+
+    /**
+     * @return Description
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * @return array
+     */
+    public function getLabels()
+    {
+        return $this->labels;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * @return int
+     */
+    public function getStop()
+    {
+        return $this->stop;
+    }
+
+    /**
+     * @return string
+     */
+    public function getVersion()
+    {
+        return $this->version;
+    }
+
+    /**
+     * @return int
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * @param int $start
+     */
+    public function setStart($start)
+    {
+        $this->start = $start;
+    }
+
+    /**
+     * @param string $name
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * @param string $title
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    /**
+     * @param int $stop
+     */
+    public function setStop($stop)
+    {
+        $this->stop = $stop;
+    }
+
+    /**
+     * @param string $version
+     */
+    public function setVersion($version)
+    {
+        $this->version = $version;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Description $description
+     */
+    public function setDescription(Description $description)
+    {
+        $this->description = $description;
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\TestCase $testCase
+     */
+    public function addTestCase(TestCase $testCase)
+    {
+        $this->testCases[$testCase->getName()] = $testCase;
+    }
+
+    /**
+     * Returns test case by name
+     * @param string $name
+     * @return \Yandex\Allure\Adapter\Model\TestCase
+     */
+    public function getTestCase($name)
+    {
+        return $this->testCases[$name];
+    }
+
+    /**
+     * Return total count of child elements (test cases or test suites)
+     * @return int
+     */
+    public function size()
+    {
+        return count($this->testCases);
+    }
+
+    /**
+     * @param \Yandex\Allure\Adapter\Model\Label $label
+     */
+    public function addLabel(Label $label)
+    {
+        $this->labels[] = $label;
+    }
+
+    /**
+     * @return string
+     */
+    public function serialize()
+    {
+        return $this->getSerializer()->serialize($this, 'xml');
+    }
+
+    /**
+     * @param string $serialized
+     * @return mixed
+     */
+    public function unserialize($serialized)
+    {
+        return $this->getSerializer()->deserialize($serialized, 'Yandex\Allure\Adapter\Model\TestSuite', 'xml');
+    }
+
+    /**
+     * @return Serializer
+     */
+    private function getSerializer()
+    {
+        if (!isset($this->serializer)) {
+            $this->serializer = SerializerBuilder::create()->build();
+        }
+
+        return $this->serializer;
+    }
+}

+ 26 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/AttachmentSupport.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Support;
+
+use Yandex\Allure\Adapter\Allure;
+use Yandex\Allure\Adapter\Event\AddAttachmentEvent;
+use Yandex\Allure\Adapter\Model;
+
+/**
+ * Use this trait in order to add Allure attachments support in your tests
+ * @package Yandex\Allure\Adapter\Support
+ */
+trait AttachmentSupport
+{
+
+    /**
+     * Adds a new attachment to report
+     * @param string $filePathOrContents either a string with file contents or file path to copy
+     * @param $caption
+     * @param $type
+     */
+    public function addAttachment($filePathOrContents, $caption, $type = null)
+    {
+        Allure::lifecycle()->fire(new AddAttachmentEvent($filePathOrContents, $caption, $type));
+    }
+}

+ 61 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/StepSupport.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Support;
+
+use Exception;
+use Yandex\Allure\Adapter\Allure;
+use Yandex\Allure\Adapter\AllureException;
+use Yandex\Allure\Adapter\Event\StepFailedEvent;
+use Yandex\Allure\Adapter\Event\StepFinishedEvent;
+use Yandex\Allure\Adapter\Event\StepStartedEvent;
+
+const STEP_LOGIC_KEY = 'logic';
+const STEP_TITLE_KEY = 'title';
+const STEP_CHILD_STEPS_KEY = 'childSteps';
+
+/**
+ * Use this trait in order to add Allure steps support
+ * @package Yandex\Allure\Adapter\Support
+ */
+trait StepSupport
+{
+
+    use Utils;
+
+    /**
+     * Adds a simple step to current test case
+     * @param string $name step name
+     * @param callable $logic anonymous function containing the entire step logic.
+     * @param string $title an optional title for the step
+     * @return mixed
+     * @throws \Yandex\Allure\Adapter\AllureException
+     * @throws \Exception
+     */
+    public function executeStep($name, $logic, $title = null)
+    {
+        $logicResult = null;
+
+        if (isset($name) && is_callable($logic)) {
+            $event = new StepStartedEvent($name);
+            if (isset($title)) {
+                $event->withTitle($title);
+            } else {
+                $event->withTitle($name);
+            }
+            Allure::lifecycle()->fire($event);
+            try {
+                $logicResult = $logic();
+                Allure::lifecycle()->fire(new StepFinishedEvent());
+            } catch (Exception $e) {
+                $stepFailedEvent = new StepFailedEvent();
+                Allure::lifecycle()->fire($stepFailedEvent);
+                Allure::lifecycle()->fire(new StepFinishedEvent());
+                throw $e;
+            }
+        } else {
+            throw new AllureException("Step name shouldn't be null and logic should be a callable.");
+        }
+
+        return $logicResult;
+    }
+}

+ 25 - 0
vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Support/Utils.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Support;
+
+use Ramsey\Uuid\Uuid;
+
+trait Utils
+{
+
+    /**
+     * @return float
+     */
+    public static function getTimestamp()
+    {
+        return round(microtime(true) * 1000);
+    }
+
+    /**
+     * @return string
+     */
+    public static function generateUUID()
+    {
+        return Uuid::uuid4()->toString();
+    }
+}

+ 170 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/AllureTest.php

@@ -0,0 +1,170 @@
+<?php
+
+namespace Yandex\Allure\Adapter;
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+use Yandex\Allure\Adapter\Event\ClearStepStorageEvent;
+use Yandex\Allure\Adapter\Event\ClearTestCaseStorageEvent;
+use Yandex\Allure\Adapter\Event\StepFinishedEvent;
+use Yandex\Allure\Adapter\Event\StepStartedEvent;
+use Yandex\Allure\Adapter\Event\TestCaseFinishedEvent;
+use Yandex\Allure\Adapter\Event\TestCaseStartedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteFinishedEvent;
+use Yandex\Allure\Adapter\Model\Attachment;
+use Yandex\Allure\Adapter\Model\Provider;
+use Yandex\Allure\Adapter\Model\Step;
+use Yandex\Allure\Adapter\Model\TestCase;
+use Yandex\Allure\Adapter\Fixtures\GenericStepEvent;
+use Yandex\Allure\Adapter\Fixtures\GenericTestCaseEvent;
+use Yandex\Allure\Adapter\Fixtures\GenericTestSuiteEvent;
+
+class AllureTest extends \PHPUnit_Framework_TestCase
+{
+    const STEP_NAME = 'step-name';
+    const TEST_CASE_NAME = 'test-case-name';
+    const TEST_SUITE_NAME = 'test-suite-name';
+    const TEST_SUITE_UUID = 'test-suite-uuid';
+    const STEP_ATTACHMENT_TITLE = 'step-attachment-caption';
+    const STEP_ATTACHMENT_SOURCE = 'step-attachment-source';
+    const STEP_ATTACHMENT_TYPE = 'text/plain';
+
+    public function testStepStorageClearEvent()
+    {
+        Allure::lifecycle()->getStepStorage()->clear();
+        Allure::lifecycle()->getStepStorage()->put(new Step());
+        Allure::lifecycle()->fire(new ClearStepStorageEvent());
+        $this->assertTrue(Allure::lifecycle()->getStepStorage()->isEmpty());
+    }
+
+    public function testTestCaseStorageClear()
+    {
+        Allure::lifecycle()->getTestCaseStorage()->clear();
+        Allure::lifecycle()->getTestCaseStorage()->put(new TestCase());
+        Allure::lifecycle()->fire(new ClearTestCaseStorageEvent());
+        $this->assertTrue(Allure::lifecycle()->getTestCaseStorage()->isEmpty());
+    }
+
+    public function testStepStartedEvent()
+    {
+        Allure::lifecycle()->getStepStorage()->clear();
+        $this->assertTrue(Allure::lifecycle()->getStepStorage()->isEmpty());
+        Allure::lifecycle()->fire(new StepStartedEvent(self::STEP_NAME));
+        $this->assertEquals(1, Allure::lifecycle()->getStepStorage()->size());
+        $step = Allure::lifecycle()->getStepStorage()->getLast();
+        $this->assertEquals(self::STEP_NAME, $step->getName());
+    }
+
+    public function testStepFinishedEvent()
+    {
+        $step = new Step();
+        $step->setName(self::STEP_NAME);
+        Allure::lifecycle()->getStepStorage()->put($step);
+        Allure::lifecycle()->fire(new StepFinishedEvent());
+        $step = Allure::lifecycle()->getStepStorage()->getLast();
+        $this->assertEquals(self::STEP_NAME, $step->getName());
+    }
+
+    public function testGenericStepEvent()
+    {
+        $step = new Step();
+        Allure::lifecycle()->getStepStorage()->clear();
+        Allure::lifecycle()->getStepStorage()->put($step);
+        Allure::lifecycle()->fire(new GenericStepEvent(self::STEP_NAME));
+        $this->assertEquals(self::STEP_NAME, $step->getName());
+    }
+
+    public function testTestCaseStarted()
+    {
+        Allure::lifecycle()->getTestCaseStorage()->clear();
+        Allure::lifecycle()->getTestSuiteStorage()->clear();
+        $this->assertTrue(Allure::lifecycle()->getTestCaseStorage()->isEmpty());
+        Allure::lifecycle()->fire(new TestCaseStartedEvent(self::TEST_SUITE_UUID, self::TEST_CASE_NAME));
+        $testCase = Allure::lifecycle()
+            ->getTestSuiteStorage()
+            ->get(self::TEST_SUITE_UUID)
+            ->getTestCase(self::TEST_CASE_NAME);
+        $this->assertNotEmpty($testCase);
+        $this->assertEquals(self::TEST_CASE_NAME, $testCase->getName());
+    }
+
+    public function testTestCaseFinishedEvent()
+    {
+        Allure::lifecycle()->getStepStorage()->clear();
+        Allure::lifecycle()->getStepStorage()->getLast(); //To initialize root step
+        Allure::lifecycle()->getTestCaseStorage()->clear();
+        $step = new Step();
+        $step->setName(self::STEP_NAME);
+        $attachment = new Attachment(
+            self::STEP_ATTACHMENT_TITLE,
+            self::STEP_ATTACHMENT_SOURCE,
+            self::STEP_ATTACHMENT_TYPE
+        );
+        Allure::lifecycle()->getStepStorage()->getLast()->addStep($step);
+        Allure::lifecycle()->getStepStorage()->getLast()->addAttachment($attachment);
+
+        $testCaseFromStorage = Allure::lifecycle()->getTestCaseStorage()->get();
+
+        Allure::lifecycle()->fire(new TestCaseFinishedEvent());
+
+        //Checking that attachments were moved
+        $attachments = $testCaseFromStorage->getAttachments();
+        $this->assertEquals(1, sizeof($attachments));
+        $attachment = array_pop($attachments);
+        $this->assertTrue(
+            ($attachment instanceof Attachment) &&
+            ($attachment->getTitle() === self::STEP_ATTACHMENT_TITLE) &&
+            ($attachment->getSource() === self::STEP_ATTACHMENT_SOURCE) &&
+            ($attachment->getType() === self::STEP_ATTACHMENT_TYPE)
+        );
+
+        //Checking that steps were moved
+        $steps = $testCaseFromStorage->getSteps();
+        $this->assertEquals(1, sizeof($steps));
+        $stepFromStorage = array_pop($steps);
+        $this->assertTrue(
+            ($stepFromStorage instanceof Step) &&
+            ($stepFromStorage->getName() === self::STEP_NAME)
+        );
+        $this->assertTrue(Allure::lifecycle()->getTestCaseStorage()->isEmpty());
+    }
+
+    public function testGenericTestCaseEvent()
+    {
+        $testCase = new TestCase();
+        Allure::lifecycle()->getTestCaseStorage()->clear();
+        Allure::lifecycle()->getTestCaseStorage()->put($testCase);
+        Allure::lifecycle()->fire(new GenericTestCaseEvent(self::TEST_CASE_NAME));
+        $this->assertEquals(self::TEST_CASE_NAME, $testCase->getName());
+    }
+
+    public function testGenericTestSuiteEvent()
+    {
+        Allure::lifecycle()->getTestSuiteStorage()->clear();
+        $event = new GenericTestSuiteEvent(self::TEST_SUITE_NAME);
+        $testSuite = Allure::lifecycle()->getTestSuiteStorage()->get($event->getUuid());
+        Allure::lifecycle()->fire($event);
+        $this->assertEquals(self::TEST_SUITE_NAME, $testSuite->getName());
+    }
+
+    public function testTestSuiteFinishedEvent()
+    {
+        Allure::lifecycle()->getTestSuiteStorage()->clear();
+        $testSuite = Allure::lifecycle()->getTestSuiteStorage()->get(self::TEST_SUITE_UUID);
+        $testSuite->addTestCase(new TestCase());
+
+        $this->assertEquals(1, Allure::lifecycle()->getTestSuiteStorage()->size());
+
+        $outputDirectory = sys_get_temp_dir();
+        AnnotationRegistry::registerAutoloadNamespace(
+            'JMS\Serializer\Annotation',
+            __DIR__ . "/../../../../vendor/jms/serializer/src"
+        );
+
+        Provider::setOutputDirectory($outputDirectory);
+        $xmlFilePath = $outputDirectory . DIRECTORY_SEPARATOR . self::TEST_SUITE_UUID . '-testsuite.xml';
+
+        Allure::lifecycle()->fire(new TestSuiteFinishedEvent(self::TEST_SUITE_UUID));
+        $this->assertTrue(Allure::lifecycle()->getTestSuiteStorage()->isEmpty());
+        $this->assertTrue(file_exists($xmlFilePath));
+    }
+}

+ 167 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/AnnotationManagerTest.php

@@ -0,0 +1,167 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Yandex\Allure\Adapter\Event\TestCaseStartedEvent;
+use Yandex\Allure\Adapter\Event\TestSuiteStartedEvent;
+use Yandex\Allure\Adapter\Model\DescriptionType;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+use Yandex\Allure\Adapter\Model\SeverityLevel;
+use Yandex\Allure\Adapter\Model\Label;
+use Yandex\Allure\Adapter\Model\LabelType;
+
+class AnnotationManagerTest extends \PHPUnit_Framework_TestCase
+{
+    public function testUpdateTestSuiteStartedEvent()
+    {
+        $instance = new Fixtures\ExampleTestSuite();
+        $testSuiteAnnotations = AnnotationProvider::getClassAnnotations($instance);
+        $annotationManager = new AnnotationManager($testSuiteAnnotations);
+        $event = new TestSuiteStartedEvent('some-name');
+        $annotationManager->updateTestSuiteEvent($event);
+
+        $this->assertEquals('test-suite-title', $event->getTitle());
+        $this->assertEquals('test-suite-description', $event->getDescription()->getValue());
+        $this->assertEquals(DescriptionType::MARKDOWN, $event->getDescription()->getType());
+        $this->assertEquals(6, sizeof($event->getLabels()));
+
+        //Check features presence
+        $features = $this->getLabelsByType($event->getLabels(), LabelType::FEATURE);
+        $this->assertEquals(2, sizeof($features));
+        $index = 1;
+        foreach ($features as $feature) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $feature);
+            $this->assertEquals("test-suite-feature$index", $feature->getValue());
+            $index++;
+        }
+
+        //Check stories presence
+        $stories = $this->getLabelsByType($event->getLabels(), LabelType::STORY);
+        $this->assertEquals(2, sizeof($stories));
+        $index = 1;
+        foreach ($stories as $story) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $story);
+            $this->assertEquals("test-suite-story$index", $story->getValue());
+            $index++;
+        }
+
+        //Check issues presence
+        $issues = $this->getLabelsByType($event->getLabels(), LabelType::ISSUE);
+        $this->assertEquals(2, sizeof($issues));
+        $index = 1;
+        foreach ($issues as $issue) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $issue);
+            $this->assertEquals("test-suite-issue$index", $issue->getValue());
+            $index++;
+        }
+
+    }
+
+    public function testUpdateTestCaseStartedEvent()
+    {
+        $instance = new Fixtures\ExampleTestSuite();
+        $testCaseAnnotations = AnnotationProvider::getMethodAnnotations($instance, 'exampleTestCase');
+        $annotationManager = new AnnotationManager($testCaseAnnotations);
+        $event = new TestCaseStartedEvent('some-uid', 'some-name');
+        $annotationManager->updateTestCaseEvent($event);
+
+        //Check scalar properties
+        $this->assertEquals('test-case-title', $event->getTitle());
+        $this->assertEquals('test-case-description', $event->getDescription()->getValue());
+        $this->assertEquals(DescriptionType::HTML, $event->getDescription()->getType());
+        $this->assertEquals(10, sizeof($event->getLabels()));
+
+        //Check id presence
+        $ids = $this->getLabelsByType($event->getLabels(), LabelType::ID);
+        $this->assertEquals(1, sizeof($ids));
+        $id = array_pop($ids);
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $id);
+        $this->assertSame("123", $id->getValue());
+
+        //Check feature presence
+        $features = $this->getLabelsByType($event->getLabels(), LabelType::FEATURE);
+        $this->assertEquals(2, sizeof($features));
+        $index = 1;
+        foreach ($features as $feature) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $feature);
+            $this->assertEquals("test-case-feature$index", $feature->getValue());
+            $index++;
+        }
+
+        //Check stories presence
+        $stories = $this->getLabelsByType($event->getLabels(), LabelType::STORY);
+        $this->assertEquals(2, sizeof($stories));
+        $index = 1;
+        foreach ($stories as $story) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $story);
+            $this->assertEquals("test-case-story$index", $story->getValue());
+            $index++;
+        }
+        
+        //Check issues presence
+        $issues = $this->getLabelsByType($event->getLabels(), LabelType::ISSUE);
+        $this->assertEquals(2, sizeof($issues));
+        $index = 1;
+        foreach ($issues as $issue) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $issue);
+            $this->assertEquals("test-case-issue$index", $issue->getValue());
+            $index++;
+        }
+
+        //Check custom labels presence
+        $customs = $this->getLabelsByType($event->getLabels(), "custom-name");
+        $this->assertEquals(2, sizeof($customs));
+        $index = 1;
+        foreach ($customs as $custom) {
+            $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $custom);
+            $this->assertEquals("custom-value-$index", $custom->getValue());
+            $index++;
+        }
+
+        //Check severity presence
+        $severities = $this->getLabelsByType($event->getLabels(), LabelType::SEVERITY);
+        $this->assertEquals(1, sizeof($severities));
+        $severity = array_pop($severities);
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Label', $severity);
+        $this->assertSame(SeverityLevel::BLOCKER, $severity->getValue());
+
+        //Check parameter presence
+        $parameters = $event->getParameters();
+        $this->assertEquals(1, sizeof($parameters));
+        $parameter = array_pop($parameters);
+
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Parameter', $parameter);
+        $this->assertSame('test-case-param-name', $parameter->getName());
+        $this->assertSame('test-case-param-value', $parameter->getValue());
+        $this->assertSame(ParameterKind::ARGUMENT, $parameter->getKind());
+    }
+
+    /**
+     * @param array $labels
+     * @param string $labelType
+     * @return array
+     */
+    private function getLabelsByType(array $labels, $labelType)
+    {
+        $filteredArray =  array_filter(
+            $labels,
+            function ($element) use ($labelType) {
+                return ($element instanceof Label) && ($element->getName() === $labelType);
+            }
+        );
+        uasort(
+            $filteredArray,
+            function (Label $l1, Label $l2) {
+                $label1Value = $l1->getValue();
+                $label2Value = $l2->getValue();
+                if ($label1Value === $label2Value) {
+                    return 0;
+                }
+
+                return ($label1Value < $label2Value) ? -1 : 1;
+            }
+        );
+
+        return $filteredArray;
+    }
+}

+ 60 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/AnnotationProviderTest.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation;
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+class AnnotationProviderTest extends \PHPUnit_Framework_TestCase
+{
+    const TYPE_CLASS = 'class';
+    const TYPE_METHOD = 'method';
+    const METHOD_NAME = 'methodWithAnnotations';
+
+    public static function setUpBeforeClass()
+    {
+        AnnotationRegistry::registerFile(__DIR__ . '/Fixtures/TestAnnotation.php');
+    }
+
+    protected function tearDown()
+    {
+        AnnotationProvider::tearDown();
+    }
+
+    public function testGetClassAnnotations()
+    {
+        $instance = new Fixtures\ClassWithAnnotations();
+        $annotations = AnnotationProvider::getClassAnnotations($instance);
+        $this->assertTrue(sizeof($annotations) === 1);
+        $annotation = array_pop($annotations);
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Annotation\Fixtures\TestAnnotation', $annotation);
+        $this->assertEquals(self::TYPE_CLASS, $annotation->value);
+    }
+
+    public function testGetMethodAnnotations()
+    {
+        $instance = new Fixtures\ClassWithAnnotations();
+        $annotations = AnnotationProvider::getMethodAnnotations($instance, self::METHOD_NAME);
+        $this->assertTrue(sizeof($annotations) === 1);
+        $annotation = array_pop($annotations);
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Annotation\Fixtures\TestAnnotation', $annotation);
+        $this->assertEquals(self::TYPE_METHOD, $annotation->value);
+    }
+
+    /**
+     * @expectedException \Doctrine\Common\Annotations\AnnotationException
+     */
+    public function testShouldThrowExceptionForNotImportedAnnotations()
+    {
+        $instance = new Fixtures\ClassWithIgnoreAnnotation();
+        AnnotationProvider::getClassAnnotations($instance);
+    }
+
+    public function testShouldIgnoreGivenAnnotations()
+    {
+        $instance = new Fixtures\ClassWithIgnoreAnnotation();
+        AnnotationProvider::addIgnoredAnnotations(['SomeCustomClassAnnotation', 'SomeCustomMethodAnnotation']);
+
+        $this->assertEmpty(AnnotationProvider::getClassAnnotations($instance));
+        $this->assertEmpty(AnnotationProvider::getMethodAnnotations($instance, 'methodWithIgnoredAnnotation'));
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ClassWithAnnotations.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation\Fixtures;
+
+/**
+ * @TestAnnotation("class")
+ */
+class ClassWithAnnotations
+{
+    /**
+     * @TestAnnotation("method")
+     */
+    public function methodWithAnnotations()
+    {
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ClassWithIgnoreAnnotation.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation\Fixtures;
+
+/**
+ * @SomeCustomClassAnnotation("foo")
+ */
+class ClassWithIgnoreAnnotation
+{
+    /**
+     * @SomeCustomMethodAnnotation("bar")
+     */
+    public function methodWithIgnoredAnnotation()
+    {
+    }
+}

+ 45 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/ExampleTestSuite.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation\Fixtures;
+
+use Yandex\Allure\Adapter\Annotation\AllureId;
+use Yandex\Allure\Adapter\Annotation\Issues;
+use Yandex\Allure\Adapter\Annotation\Title;
+use Yandex\Allure\Adapter\Annotation\Description;
+use Yandex\Allure\Adapter\Annotation\Features;
+use Yandex\Allure\Adapter\Annotation\Stories;
+use Yandex\Allure\Adapter\Annotation\Severity;
+use Yandex\Allure\Adapter\Annotation\Label;
+use Yandex\Allure\Adapter\Annotation\Labels;
+use Yandex\Allure\Adapter\Annotation\Parameter;
+use Yandex\Allure\Adapter\Model\DescriptionType;
+use Yandex\Allure\Adapter\Model\SeverityLevel;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+
+/**
+ * @Title("test-suite-title")
+ * @Description(value="test-suite-description", type=DescriptionType::MARKDOWN)
+ * @Features({"test-suite-feature1", "test-suite-feature2"})
+ * @Stories({"test-suite-story1", "test-suite-story2"})
+ * @Issues({"test-suite-issue1", "test-suite-issue2"})
+ */
+class ExampleTestSuite
+{
+    /**
+     * @AllureId("123")
+     * @Title("test-case-title")
+     * @Description(value="test-case-description", type=DescriptionType::HTML)
+     * @Features({"test-case-feature1", "test-case-feature2"})
+     * @Stories({"test-case-story1", "test-case-story2"})
+     * @Severity(SeverityLevel::BLOCKER)
+     * @Parameter(name = "test-case-param-name", value = "test-case-param-value", kind = ParameterKind::ARGUMENT)
+     * @Labels({
+     *     @Label(name = "custom-name", value = "custom-value-1"),
+     *     @Label(name = "custom-name", value = "custom-value-2")
+     * })
+     * @Issues({"test-case-issue1", "test-case-issue2"})
+     */
+    public function exampleTestCase()
+    {
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Annotation/Fixtures/TestAnnotation.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Annotation\Fixtures;
+
+/**
+ * @Annotation
+ * @Target({"CLASS", "METHOD"})
+ */
+class TestAnnotation
+{
+    /**
+     * @var string
+     * @Required
+     */
+    public $value;
+}

+ 84 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/AddAttachmentEventTest.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Provider;
+use Yandex\Allure\Adapter\Model\Step;
+
+class AddAttachmentEventTest extends \PHPUnit_Framework_TestCase
+{
+    const ATTACHMENT_CAPTION = 'test-caption';
+
+    public function testEventWithFile()
+    {
+        $attachmentCaption = self::ATTACHMENT_CAPTION;
+        $attachmentType = 'application/json';
+        $correctExtension = 'json';
+        $tmpDirectory = sys_get_temp_dir();
+        Provider::setOutputDirectory($tmpDirectory);
+        $tmpFilename = tempnam($tmpDirectory, 'allure-test');
+        file_put_contents($tmpFilename, $this->getTestContents());
+        $sha1Sum = sha1_file($tmpFilename);
+
+        $event = new AddAttachmentEvent($tmpFilename, $attachmentCaption, $attachmentType);
+        $step = new Step();
+        $event->process($step);
+
+        $attachmentFileName = $event->getOutputFileName($sha1Sum, $correctExtension);
+        $attachmentOutputPath = $event->getOutputPath($sha1Sum, $correctExtension);
+        $this->checkAttachmentIsCorrect(
+            $step,
+            $attachmentOutputPath,
+            $attachmentFileName,
+            $attachmentCaption,
+            $attachmentType
+        );
+    }
+
+    public function testEventWithStringContents()
+    {
+        $attachmentCaption = self::ATTACHMENT_CAPTION;
+        $attachmentType = 'text/plain';
+        $correctExtension = 'txt';
+        $tmpDirectory = sys_get_temp_dir();
+        Provider::setOutputDirectory($tmpDirectory);
+        $contents = $this->getTestContents();
+        $sha1Sum = sha1($contents);
+
+        $event = new AddAttachmentEvent($contents, $attachmentCaption);
+        $step = new Step();
+        $event->process($step);
+
+        $attachmentFileName = $event->getOutputFileName($sha1Sum, $correctExtension);
+        $attachmentOutputPath = $event->getOutputPath($sha1Sum, $correctExtension);
+        $this->checkAttachmentIsCorrect(
+            $step,
+            $attachmentOutputPath,
+            $attachmentFileName,
+            $attachmentCaption,
+            $attachmentType
+        );
+    }
+
+    private function checkAttachmentIsCorrect(
+        Step $step,
+        $attachmentOutputPath,
+        $attachmentFileName,
+        $attachmentCaption,
+        $attachmentType
+    ) {
+        $this->assertTrue(file_exists($attachmentOutputPath));
+        $attachments = $step->getAttachments();
+        $this->assertEquals(1, sizeof($attachments));
+        $attachment = array_pop($attachments);
+        $this->assertInstanceOf('Yandex\Allure\Adapter\Model\Attachment', $attachment);
+        $this->assertEquals($attachmentFileName, $attachment->getSource());
+        $this->assertEquals($attachmentCaption, $attachment->getTitle());
+        $this->assertEquals($attachmentType, $attachment->getType());
+    }
+
+    private function getTestContents()
+    {
+        return str_shuffle('test-contents');
+    }
+}

+ 29 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/AddParameterEventTest.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Parameter;
+use Yandex\Allure\Adapter\Model\ParameterKind;
+use Yandex\Allure\Adapter\Model\TestCase;
+
+class AddParameterEventTest extends \PHPUnit_Framework_TestCase
+{
+    public function testEvent()
+    {
+        $parameterName = 'test-name';
+        $parameterValue = 'test-value';
+        $parameterKind = ParameterKind::ARGUMENT;
+        $event = new AddParameterEvent($parameterName, $parameterValue, $parameterKind);
+        $testCase = new TestCase();
+        $event->process($testCase);
+        $this->assertEquals(1, sizeof($testCase->getParameters()));
+        $parameters = $testCase->getParameters();
+        $parameter = array_pop($parameters);
+        $this->assertTrue(
+            ($parameter instanceof Parameter) &&
+            ($parameter->getName() === $parameterName) &&
+            ($parameter->getValue() === $parameterValue) &&
+            ($parameter->getKind() === $parameterKind)
+        );
+    }
+}

+ 41 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/RemoveAttachmentsEventTest.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Attachment;
+use Yandex\Allure\Adapter\Model\Step;
+
+const ATTACHMENT_TYPE = 'text/plain';
+
+class RemoveAttachmentsEventTest extends \PHPUnit_Framework_TestCase
+{
+    public function testLifecycle()
+    {
+        $attachmentTitle = 'some-title';
+        $pattern = 'matching';
+        $tmpDirectory = sys_get_temp_dir();
+        $matchingFilename = tempnam($tmpDirectory, $pattern);
+        touch($matchingFilename);
+        $this->assertTrue(file_exists($matchingFilename));
+
+        $notMatchingFilename = tempnam($tmpDirectory, 'excluded');
+
+        $step = new Step();
+        $step->addAttachment(new Attachment($attachmentTitle, $matchingFilename, ATTACHMENT_TYPE));
+        $step->addAttachment(new Attachment($attachmentTitle, $notMatchingFilename, ATTACHMENT_TYPE));
+
+        $this->assertEquals(2, sizeof($step->getAttachments()));
+
+        $event = new RemoveAttachmentsEvent("/$pattern/i");
+        $event->process($step);
+
+        $this->assertEquals(1, sizeof($step->getAttachments()));
+        $this->assertFalse(file_exists($matchingFilename));
+        $attachments = $step->getAttachments();
+        $attachment = array_pop($attachments);
+        $this->assertTrue(
+            ($attachment instanceof Attachment) &&
+            ($attachment->getSource() === $notMatchingFilename)
+        );
+    }
+}

+ 24 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepCanceledEventTest.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class StepCanceledEventTest extends StepStatusChangedEventTest
+{
+    /**
+     * @return string
+     */
+    protected function getTestedStatus()
+    {
+        return Status::CANCELED;
+    }
+
+    /**
+     * @return StepEvent
+     */
+    protected function getStepEvent()
+    {
+        return new StepCanceledEvent();
+    }
+}

+ 24 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepFailedEventTest.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class StepFailedEventTest extends StepStatusChangedEventTest
+{
+    /**
+     * @return string
+     */
+    protected function getTestedStatus()
+    {
+        return Status::FAILED;
+    }
+
+    /**
+     * @return StepEvent
+     */
+    protected function getStepEvent()
+    {
+        return new StepFailedEvent();
+    }
+}

+ 16 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepFinishedEventTest.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Step;
+
+class StepFinishedEventTest extends \PHPUnit_Framework_TestCase
+{
+    public function testEvent()
+    {
+        $step = new Step();
+        $event = new StepFinishedEvent();
+        $event->process($step);
+        $this->assertNotEmpty($step->getStop());
+    }
+}

+ 26 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepStartedEventTest.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+use Yandex\Allure\Adapter\Model\Step;
+
+class StepStartedEventTest extends \PHPUnit_Framework_TestCase
+{
+    public function testEvent()
+    {
+        $step = new Step();
+        $stepName = 'step-name';
+        $stepTitle = 'step-title';
+        $event = new StepStartedEvent($stepName);
+        $event->withTitle($stepTitle);
+        $event->process($step);
+        $this->assertEquals(Status::PASSED, $step->getStatus());
+        $this->assertEquals($stepTitle, $step->getTitle());
+        $this->assertNotEmpty($step->getStart());
+        $this->assertEquals($stepName, $step->getName());
+        $this->assertEmpty($step->getStop());
+        $this->assertEmpty($step->getSteps());
+        $this->assertEmpty($step->getAttachments());
+    }
+}

+ 26 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/StepStatusChangedEventTest.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Step;
+
+abstract class StepStatusChangedEventTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @return string
+     */
+    abstract protected function getTestedStatus();
+
+    /**
+     * @return StepEvent
+     */
+    abstract protected function getStepEvent();
+
+    public function testEvent()
+    {
+        $step = new Step();
+        $event = $this->getStepEvent();
+        $event->process($step);
+        $this->assertEquals($this->getTestedStatus(), $step->getStatus());
+    }
+}

+ 17 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/Fixtures/MockedRootStepStorage.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage\Fixtures;
+
+use Yandex\Allure\Adapter\Event\Storage\StepStorage;
+use Yandex\Allure\Adapter\Model\Step;
+
+class MockedRootStepStorage extends StepStorage
+{
+    protected function getRootStep()
+    {
+        $rootStep = new Step();
+        $rootStep->setName('root-step');
+
+        return $rootStep;
+    }
+}

+ 27 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/StepStorageTest.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+use Yandex\Allure\Adapter\Model\Step;
+
+class StepStorageTest extends \PHPUnit_Framework_TestCase
+{
+    const TEST_STEP_NAME = 'test-step';
+
+    public function testEmptyStorage()
+    {
+        $storage = new Fixtures\MockedRootStepStorage();
+        $this->assertTrue($storage->isRootStep($storage->getLast()));
+        $this->assertTrue($storage->isRootStep($storage->pollLast()));
+        $this->assertTrue($storage->isEmpty());
+    }
+
+    public function testNonEmptyStorage()
+    {
+        $storage = new Fixtures\MockedRootStepStorage();
+        $step = new Step();
+        $step->setName(self::TEST_STEP_NAME);
+        $storage->put($step);
+        $this->assertEquals($storage->getLast()->getName(), self::TEST_STEP_NAME);
+    }
+}

+ 28 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/TestCaseStorageTest.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+use Yandex\Allure\Adapter\Model\TestCase;
+
+class TestCaseStorageTest extends \PHPUnit_Framework_TestCase
+{
+    public function testLifecycle()
+    {
+        $storage = new TestCaseStorage();
+        $testCase = $storage->get();
+        $this->assertEmpty($testCase->getName());
+
+        $name1 = 'test-name1';
+        $testCase->setName($name1);
+        $this->assertEquals($name1, $storage->get()->getName());
+
+        $name2 = 'test-name1';
+        $testCase = new TestCase();
+        $testCase->setName($name2);
+        $storage->put($testCase);
+        $this->assertEquals($name2, $storage->get()->getName());
+
+        $storage->clear();
+        $this->assertEmpty($storage->get()->getName());
+    }
+}

+ 20 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/Storage/TestSuiteStorageTest.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event\Storage;
+
+class TestSuiteStorageTest extends \PHPUnit_Framework_TestCase
+{
+    public function testLifecycle()
+    {
+        $storage = new TestSuiteStorage();
+        $uuid = 'some-uuid';
+        $name = 'some-name';
+        $testSuite = $storage->get($uuid);
+        $this->assertEmpty($testSuite->getName());
+        $testSuite->setName($name);
+        $this->assertEquals($name, $storage->get($uuid)->getName());
+
+        $storage->remove($uuid);
+        $this->assertEmpty($storage->get($uuid)->getName());
+    }
+}

+ 24 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseBrokenEventTest.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseBrokenEventTest extends TestCaseStatusChangedEventTest
+{
+    /**
+     * @return string
+     */
+    protected function getTestedStatus()
+    {
+        return Status::BROKEN;
+    }
+
+    /**
+     * @return TestCaseStatusChangedEvent
+     */
+    protected function getTestCaseStatusChangedEvent()
+    {
+        return new TestCaseBrokenEvent();
+    }
+}

+ 24 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseCanceledEventTest.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseCanceledEventTest extends TestCaseStatusChangedEventTest
+{
+    /**
+     * @return string
+     */
+    protected function getTestedStatus()
+    {
+        return Status::CANCELED;
+    }
+
+    /**
+     * @return TestCaseStatusChangedEvent
+     */
+    protected function getTestCaseStatusChangedEvent()
+    {
+        return new TestCaseCanceledEvent();
+    }
+}

+ 24 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseFailedEventTest.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Yandex\Allure\Adapter\Event;
+
+use Yandex\Allure\Adapter\Model\Status;
+
+class TestCaseFailedEventTest extends TestCaseStatusChangedEventTest
+{
+    /**
+     * @return string
+     */
+    protected function getTestedStatus()
+    {
+        return Status::FAILED;
+    }
+
+    /**
+     * @return TestCaseStatusChangedEvent
+     */
+    protected function getTestCaseStatusChangedEvent()
+    {
+        return new TestCaseFailedEvent();
+    }
+}

+ 0 - 0
vendor/allure-framework/allure-php-api/test/Yandex/Allure/Adapter/Event/TestCaseFinishedEventTest.php


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä