@@ -94,7 +94,7 @@ |
||
94 | 94 | protected function translatePart($translate, $result, $textDomain, $locale) |
95 | 95 | { |
96 | 96 | $newResult = parent::translate($result, $textDomain, $locale); |
97 | - $translate = str_replace('{{' . $result . '}}', $newResult, $translate); |
|
97 | + $translate = str_replace('{{'.$result.'}}', $newResult, $translate); |
|
98 | 98 | return $translate; |
99 | 99 | } |
100 | 100 | } |
101 | 101 | \ No newline at end of file |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | public function logAssertionSuccess(AbstractAssertion $assertion, array $extra) |
81 | 81 | { |
82 | 82 | $extra = array_merge($extra, ['type' => 'assertion', 'result' => self::STATUS_PASSED]); |
83 | - $this->info(get_class($assertion) . ' - passed', $this->createExtra($extra)); |
|
83 | + $this->info(get_class($assertion).' - passed', $this->createExtra($extra)); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function logAssertionFailure(Exception $e, AbstractAssertion $assertion, array $extra) |
87 | 87 | { |
88 | 88 | $extra = array_merge($extra, ['type' => 'assertion', 'result' => self::STATUS_FAILED, 'stack_trace' => $e->getTrace()]); |
89 | - $this->err(get_class($assertion) . ' - ' . $e->getMessage(), $this->createExtra($extra)); |
|
89 | + $this->err(get_class($assertion).' - '.$e->getMessage(), $this->createExtra($extra)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public function createExtra($includeArray = []) |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | { |
149 | 149 | if ($test instanceof \PHPUnit_Framework_TestCase) { |
150 | 150 | if (!$this->testName) { |
151 | - $this->setTestName(get_class($test) . '::' . $test->getName()); |
|
151 | + $this->setTestName(get_class($test).'::'.$test->getName()); |
|
152 | 152 | } |
153 | - $this->invokedTest = get_class($test) . '::' . $test->getName(); |
|
153 | + $this->invokedTest = get_class($test).'::'.$test->getName(); |
|
154 | 154 | $this->setTestStatus(self::STATUS_PASSED); |
155 | 155 | } |
156 | 156 |
@@ -11,6 +11,6 @@ |
||
11 | 11 | $encoded = base64_encode($rand); |
12 | 12 | $username = preg_replace('/\W/', '', $encoded); |
13 | 13 | |
14 | - return $username . '@' . $domain; |
|
14 | + return $username.'@'.$domain; |
|
15 | 15 | } |
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $html = $this->webDriver->byXpath('//body')->getAttribute('innerHTML'); |
110 | 110 | $doc = new \DOMDocument(); |
111 | 111 | libxml_use_internal_errors(true); |
112 | - $doc->loadHTML('<html><body>' . $html . '</body></html>'); |
|
112 | + $doc->loadHTML('<html><body>'.$html.'</body></html>'); |
|
113 | 113 | $xpath = new \DOMXPath($doc); |
114 | 114 | |
115 | 115 | $baseMatches = $this->getBaseMatches($xpath, $baseChild); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | if (!count($finalMatches)) { |
124 | - throw new UnableToExtractMenuXpathException('Could not extract menu Xpaths for the category path: ' . $this->path); |
|
124 | + throw new UnableToExtractMenuXpathException('Could not extract menu Xpaths for the category path: '.$this->path); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $this->baseXpath = $finalMatches[0]['baseNodePath']; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $baseMatches = []; |
181 | 181 | foreach ($this->baseSearchOrder as $base) { |
182 | - $baseQuery = '//' . $base; |
|
182 | + $baseQuery = '//'.$base; |
|
183 | 183 | $nodeList = $xpath->query($baseQuery); |
184 | 184 | foreach ($nodeList as $index => $node) { |
185 | 185 | /* @var $node \DOMElement */ |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | if ($element->isDisplayed()) { |
191 | 191 | foreach ($this->childSearchOrder as $order) { |
192 | 192 | $childQueryXpath = sprintf($order, $baseChild); |
193 | - $childQuery = $path . '/descendant::' . $childQueryXpath; |
|
193 | + $childQuery = $path.'/descendant::'.$childQueryXpath; |
|
194 | 194 | $childNodeList = $xpath->query($childQuery); |
195 | 195 | if ($childNodeList instanceof \DOMNodeList) { |
196 | 196 | foreach ($childNodeList as $node) { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * We re-run the test method each time because Dec 01 01:01:01 could match only the first 01. So we |
44 | 44 | * have to be a bit greedy here. |
45 | 45 | */ |
46 | - $fn = 'test' . ucfirst($term); |
|
46 | + $fn = 'test'.ucfirst($term); |
|
47 | 47 | if ($this->$fn($part) && $matchedParts[$term] === null) { |
48 | 48 | $matchedParts[$term] = $key; |
49 | 49 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | $foundDate = ''; |
69 | 69 | for ($i = (int)$min; $i <= (int)$max; $i++) { |
70 | - $foundDate .= ' ' . $parts[$i]; |
|
70 | + $foundDate .= ' '.$parts[$i]; |
|
71 | 71 | } |
72 | 72 | $parse = date_parse(trim($foundDate)); |
73 | 73 | if (isset($parse['error_count']) && $parse['error_count'] == 0) { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | $parse = date_parse($part); |
116 | - if (!empty($parse) && $parse['day'] !== false && $parse['error_count'] == 0 ) { |
|
116 | + if (!empty($parse) && $parse['day'] !== false && $parse['error_count'] == 0) { |
|
117 | 117 | return true; |
118 | 118 | } else if (preg_match('/^\d{1,2}[\/\\-]\d{1,2}[\/\\-]\d{1,2}$/', $part)) { |
119 | 119 | return true; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return true; |
128 | 128 | } |
129 | 129 | $parse = date_parse($part); |
130 | - if (!empty($parse) && $parse['month'] !== false && $parse['error_count'] == 0 ) { |
|
130 | + if (!empty($parse) && $parse['month'] !== false && $parse['error_count'] == 0) { |
|
131 | 131 | return true; |
132 | 132 | } else if (preg_match('/^\d{1,2}[\/\\-]\d{1,2}[\/\\-]\d{1,2}$/', $part)) { |
133 | 133 | return true; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if (!empty($parse) && $parse['year'] !== false && $parse['error_count'] == 0) { |
142 | 142 | return true; |
143 | 143 | // DateTime parses 2015 as 20:15:00, so this is to account for the unique condition. |
144 | - } else if (strlen($part) ==4 ) { |
|
144 | + } else if (strlen($part) == 4) { |
|
145 | 145 | if ($parse['second'] === 0 && $parse['hour'] == substr($part, 0, 2) && $parse['minute'] == substr($part, 2, 2)) { |
146 | 146 | return true; |
147 | 147 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | return false; |
163 | 163 | } |
164 | 164 | $parse = date_parse($part); |
165 | - if (!empty($parse) && $parse['hour'] !== false && $parse['error_count'] == 0 ) { |
|
165 | + if (!empty($parse) && $parse['hour'] !== false && $parse['error_count'] == 0) { |
|
166 | 166 | return true; |
167 | 167 | } |
168 | 168 | return false; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | $parse = date_parse($part); |
182 | - if (!empty($parse) && $parse['minute'] !== false && $parse['error_count'] == 0 ) { |
|
182 | + if (!empty($parse) && $parse['minute'] !== false && $parse['error_count'] == 0) { |
|
183 | 183 | return true; |
184 | 184 | |
185 | 185 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | $parse = date_parse($part); |
200 | - if (!empty($parse) && $parse['second'] !== false && $parse['error_count'] == 0 ) { |
|
200 | + if (!empty($parse) && $parse['second'] !== false && $parse['error_count'] == 0) { |
|
201 | 201 | return true; |
202 | 202 | } |
203 | 203 | return false; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | case self::INSTRUCTION_MOUSE_CLICK: |
73 | 73 | $element = $this->webdriver->byXpath($xpath); |
74 | 74 | if (!$element->isDisplayed()) { |
75 | - throw new ElementNotVisibleException('The element is not visible: ' . $xpath); |
|
75 | + throw new ElementNotVisibleException('The element is not visible: '.$xpath); |
|
76 | 76 | } |
77 | 77 | $element->click(); |
78 | 78 | break; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | case self::INSTRUCTION_WAIT_FOR_NOT_EXISTS: |
87 | 87 | $this->webdriver->wait()->until( |
88 | 88 | ExpectedCondition::not( |
89 | - ExpectedCondition::elementExists( $xpath, WebDriver::BY_XPATH) |
|
89 | + ExpectedCondition::elementExists($xpath, WebDriver::BY_XPATH) |
|
90 | 90 | ) |
91 | 91 | ); |
92 | 92 | break; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ); |
106 | 106 | break; |
107 | 107 | default: |
108 | - throw new InvalidConfigurationException('Unknown login instruction: ' .$instruction ); |
|
108 | + throw new InvalidConfigurationException('Unknown login instruction: '.$instruction); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $xpath = sprintf('//a[concat(" ",normalize-space(.)," ") = " %s "]|//*[concat(" ",normalize-space(.)," ") = " %s "]/ancestor::a', $part, $part); |
53 | 53 | $elements = $this->webDriver->findElements(WebDriverBy::xpath($xpath)); |
54 | 54 | $action = false; |
55 | - $this->testCase->assertNotCount(0, $elements, 'Did not find 1 or more elements with the Xpath: ' . $xpath); |
|
55 | + $this->testCase->assertNotCount(0, $elements, 'Did not find 1 or more elements with the Xpath: '.$xpath); |
|
56 | 56 | foreach ($elements as $element) { |
57 | 57 | // Sometimes responsive templates have multiple nav menus. So we iterate over the results to find a visible element. |
58 | 58 | if (!$element->isDisplayed()) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $action = true; |
67 | 67 | break; // If either of these options work we don't need to iterate over the remain elements |
68 | 68 | } |
69 | - $this->testCase->assertTrue($action, 'No action was taken. Elements not visible? Xpath: ' . $xpath); |
|
69 | + $this->testCase->assertTrue($action, 'No action was taken. Elements not visible? Xpath: '.$xpath); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // We will have already clicked it previously |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | protected function execute(InputInterface $input, OutputInterface $output) |
35 | 35 | { |
36 | - if (!file_exists($this->path . '/magium.json')) { |
|
36 | + if (!file_exists($this->path.'/magium.json')) { |
|
37 | 37 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
38 | 38 | } |
39 | 39 | $reader = new \Zend\Config\Reader\Json(); |
40 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
40 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
41 | 41 | |
42 | 42 | $name = $input->getArgument('name'); |
43 | 43 | $value = $input->getArgument('value'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $config->config->$name = $value; |
53 | 53 | |
54 | 54 | $writer = new Json(); |
55 | - $writer->toFile($this->path . '/magium.json', $config); |
|
55 | + $writer->toFile($this->path.'/magium.json', $config); |
|
56 | 56 | $output->writeln(sprintf('Wrote value for "%s" to %s/magium.json', $name, $this->path)); |
57 | 57 | } |
58 | 58 |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | protected function execute(InputInterface $input, OutputInterface $output) |
35 | 35 | { |
36 | - if (!file_exists($this->path . '/magium.json')) { |
|
36 | + if (!file_exists($this->path.'/magium.json')) { |
|
37 | 37 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
38 | 38 | } |
39 | 39 | $reader = new \Zend\Config\Reader\Json(); |
40 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
40 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
41 | 41 | |
42 | 42 | $name = $input->getArgument('name'); |
43 | 43 | $value = $input->getArgument('value'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $config->config->$name = $value; |
53 | 53 | |
54 | 54 | $writer = new Json(); |
55 | - $writer->toFile($this->path . '/magium.json', $config); |
|
55 | + $writer->toFile($this->path.'/magium.json', $config); |
|
56 | 56 | $output->writeln(sprintf('Wrote value for "%s" to %s/magium.json', $name, $this->path)); |
57 | 57 | } |
58 | 58 |