@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | public function initializeMultilanguage() { |
49 | - if(isset($this->multilingual_parameters['language'])&&isset($this->multilingual_parameters['translations'])) { |
|
49 | + if (isset($this->multilingual_parameters['language'])&&isset($this->multilingual_parameters['translations'])) { |
|
50 | 50 | $this->parseTranslationFile(); |
51 | 51 | } |
52 | 52 | } |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | |
61 | 61 | public function localizeTarget($target) { |
62 | 62 | $translations = $this->multilingual_parameters['translations']; |
63 | - if(isset($this->translations[$target][$this->multilingual_parameters['language']])){ |
|
63 | + if (isset($this->translations[$target][$this->multilingual_parameters['language']])) { |
|
64 | 64 | $target = $this->translations[$target][$this->multilingual_parameters['language']]; |
65 | 65 | return $target; |
66 | 66 | } |
67 | 67 | elseif (isset($this->translations[$target])) { |
68 | 68 | return $target; |
69 | 69 | } |
70 | - else throw new \Exception ("The text '$target'' is not defined in '$translations' translation file."); |
|
70 | + else throw new \Exception("The text '$target'' is not defined in '$translations' translation file."); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function localizeField($field) { |
78 | 78 | $re = "/(?:[-])(en)(?:[-])/"; |
79 | 79 | $language = "-".$this->multilingual_parameters['language']."-"; |
80 | - $field = preg_replace($re, $language,$field); |
|
80 | + $field = preg_replace($re, $language, $field); |
|
81 | 81 | return $field; |
82 | 82 | } |
83 | 83 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @When /^I wait for localized text "([^"]*)" to appear with max time "([^"]+)"(?: seconds)?$/ |
168 | 168 | */ |
169 | - public function iWaitForLocalizedTextToAppearWithMaxTime($target, $maxExecutionTime){ |
|
169 | + public function iWaitForLocalizedTextToAppearWithMaxTime($target, $maxExecutionTime) { |
|
170 | 170 | $target = $this->localizeTarget($target); |
171 | 171 | $this->FeatureContext->iWaitForTextToAppearWithMaxTime($target, $maxExecutionTime); |
172 | 172 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @Given I click localized :link in the :rowText row |
191 | 191 | * @Then I (should )see the localized :link in the :rowText row |
192 | 192 | */ |
193 | - public function assertLocalizedClickInTableRow($link, $rowText){ |
|
193 | + public function assertLocalizedClickInTableRow($link, $rowText) { |
|
194 | 194 | $link = $this->localizeTarget($link); |
195 | 195 | $page = $this->getSession()->getPage(); |
196 | 196 | if ($link_element = $this->getTableRow($page, $rowText)->findLink($link)) { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @When /^I click on the localized text "([^"]*)" in the "(?P<region>[^"]*)"(?:| region)$/ |
221 | 221 | */ |
222 | - public function iClickOnTheLocalizedTextInRegion($text, $region){ |
|
222 | + public function iClickOnTheLocalizedTextInRegion($text, $region) { |
|
223 | 223 | $text = $this->localizeTarget($text); |
224 | 224 | $this->FeatureContext->iClickOnTheTextInRegion($text, $region); |
225 | 225 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $session = $this->getSession(); |
51 | 51 | $element = $session->getPage()->find( |
52 | 52 | 'xpath', |
53 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '//*[contains(text(),"' . $text . '")]')); |
|
53 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '//*[contains(text(),"'.$text.'")]')); |
|
54 | 54 | |
55 | 55 | if (null === $element) { |
56 | 56 | throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | |
62 | 62 | public function assertValueInInput($value, $input) { |
63 | 63 | |
64 | - if (substr($input,0,1) != "#") { |
|
65 | - $input = "#" . $input; |
|
64 | + if (substr($input, 0, 1) != "#") { |
|
65 | + $input = "#".$input; |
|
66 | 66 | } |
67 | 67 | $session = $this->getSession(); |
68 | 68 | $element = $session->getPage()->find('css', $input); |
69 | 69 | $text = ""; |
70 | 70 | |
71 | - if(isset($element)) { |
|
71 | + if (isset($element)) { |
|
72 | 72 | $text = $element->getValue(); |
73 | 73 | } |
74 | 74 | else { |
75 | 75 | throw new \Exception(sprintf("Element is null")); |
76 | 76 | } |
77 | 77 | |
78 | - if($text === $value) { |
|
78 | + if ($text === $value) { |
|
79 | 79 | return true; |
80 | 80 | } |
81 | 81 | else { |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | |
108 | 108 | $html = $this->getSession()->getDriver()->getContent(); |
109 | 109 | $text = $this->validateTextForSearchInSource($text); |
110 | - $regex = '/' . $text . '/'; |
|
110 | + $regex = '/'.$text.'/'; |
|
111 | 111 | |
112 | 112 | preg_match($regex, $html, $results); |
113 | 113 | |
114 | 114 | if ($results == null) { |
115 | - throw new \Exception('The searched text ' . $text . ' was not found in the source of the page.'); |
|
115 | + throw new \Exception('The searched text '.$text.' was not found in the source of the page.'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | return true; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $session = $this->getSession(); |
133 | 133 | $element = $session->getPage()->find('region', $region)->find('xpath', $session->getSelectorsHandler()->selectorToXpath('xpath', |
134 | - '//*[contains(text(),"' . $text . '")]')); |
|
134 | + '//*[contains(text(),"'.$text.'")]')); |
|
135 | 135 | |
136 | 136 | if (null === $element) { |
137 | 137 | throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | $session = $this->getSession(); |
146 | 146 | $element = $session->getPage()->find('region', $region)->find('xpath', $session->getSelectorsHandler()->selectorToXpath('xpath', |
147 | - '//*[contains(text(),"' . $text . '")]')); |
|
147 | + '//*[contains(text(),"'.$text.'")]')); |
|
148 | 148 | |
149 | 149 | if (null === $element) { |
150 | 150 | throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |