1 | <?php |
||
21 | class Test implements TestInterface |
||
22 | { |
||
23 | /** |
||
24 | * The identifier of this test. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $identifier; |
||
29 | |||
30 | /** |
||
31 | * The available variantns for this test. |
||
32 | * |
||
33 | * @var VariantInterface[] |
||
34 | */ |
||
35 | private $variants; |
||
36 | |||
37 | /** |
||
38 | * Case specific options |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | private $options = []; |
||
43 | |||
44 | /** |
||
45 | * Initializes a new instance of this class. |
||
46 | * |
||
47 | * @param string $identifier The identifier |
||
48 | * @param VariantInterface[] $variants The variants that this test has. |
||
49 | * @param array $options Case specific test options. |
||
50 | */ |
||
51 | 28 | public function __construct($identifier, $variants = [], array $options = []) |
|
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | 17 | public function getIdentifier() |
|
69 | |||
70 | /** |
||
71 | * Adds a variant to this test. |
||
72 | * |
||
73 | * @throws DuplicateVariantException |
||
74 | * |
||
75 | * @param VariantInterface $variant The variant to add to this test. |
||
76 | */ |
||
77 | 12 | public function addVariant(VariantInterface $variant) |
|
85 | |||
86 | /** |
||
87 | * Sets the variants in this test. |
||
88 | * |
||
89 | * @param VariantInterface[] $variants The variants to set. |
||
90 | */ |
||
91 | 29 | public function setVariants($variants) |
|
99 | |||
100 | /** |
||
101 | * {@inheritDoc} |
||
102 | */ |
||
103 | 7 | public function getVariants() |
|
107 | |||
108 | /** |
||
109 | * {@inheritDoc} |
||
110 | * |
||
111 | * @param string $identifier The identifier of the variant to get. |
||
112 | */ |
||
113 | 6 | public function getVariant($identifier) |
|
121 | |||
122 | /** |
||
123 | * Get the test options |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | 4 | public function getOptions() |
|
131 | } |
||
132 |