1 | <?php |
||
45 | class ArrayKeywords implements KeywordsInterface |
||
46 | { |
||
47 | private $keywords = array(); |
||
48 | private $keywordString = array(); |
||
49 | private $language; |
||
50 | |||
51 | /** |
||
52 | * Initializes holder with keywords. |
||
53 | * |
||
54 | * @param array $keywords Keywords array |
||
55 | */ |
||
56 | 247 | public function __construct(array $keywords) |
|
60 | |||
61 | /** |
||
62 | * Sets keywords holder language. |
||
63 | * |
||
64 | * @param string $language Language name |
||
65 | */ |
||
66 | 245 | public function setLanguage($language) |
|
67 | { |
||
68 | 245 | if (!isset($this->keywords[$language])) { |
|
69 | 3 | $this->language = 'en'; |
|
70 | } else { |
||
71 | 245 | $this->language = $language; |
|
72 | } |
||
73 | 245 | } |
|
74 | |||
75 | /** |
||
76 | * Returns Feature keywords (splitted by "|"). |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 245 | public function getFeatureKeywords() |
|
84 | |||
85 | /** |
||
86 | * Returns Background keywords (splitted by "|"). |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | 245 | public function getBackgroundKeywords() |
|
94 | |||
95 | /** |
||
96 | * Returns Scenario keywords (splitted by "|"). |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | 245 | public function getScenarioKeywords() |
|
104 | |||
105 | /** |
||
106 | * Returns Scenario Outline keywords (splitted by "|"). |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | 245 | public function getOutlineKeywords() |
|
114 | |||
115 | /** |
||
116 | * Returns Examples keywords (splitted by "|"). |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 245 | public function getExamplesKeywords() |
|
124 | |||
125 | /** |
||
126 | * Returns Given keywords (splitted by "|"). |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 236 | public function getGivenKeywords() |
|
134 | |||
135 | /** |
||
136 | * Returns When keywords (splitted by "|"). |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | 236 | public function getWhenKeywords() |
|
144 | |||
145 | /** |
||
146 | * Returns Then keywords (splitted by "|"). |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | 236 | public function getThenKeywords() |
|
154 | |||
155 | /** |
||
156 | * Returns And keywords (splitted by "|"). |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | 236 | public function getAndKeywords() |
|
164 | |||
165 | /** |
||
166 | * Returns But keywords (splitted by "|"). |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | 236 | public function getButKeywords() |
|
174 | |||
175 | /** |
||
176 | * Returns all step keywords (Given, When, Then, And, But). |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | 232 | public function getStepKeywords() |
|
200 | } |
||
201 |