@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | $log = $this->webDriver->manage()->getLog('browser'); |
15 | 15 | foreach ($log as $l) { |
16 | - $this->logger->err('Message found: ' . serialize($l)); |
|
16 | + $this->logger->err('Message found: '.serialize($l)); |
|
17 | 17 | } |
18 | 18 | $this->testCase->assertCount(0, $log); |
19 | 19 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function setById($id, $value) |
31 | 31 | { |
32 | - $this->set('id:' . $id, $value); |
|
32 | + $this->set('id:'.$id, $value); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function set($name, $value) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } else { |
42 | 42 | $element = $this->webDriver->byXpath(sprintf('//label[.="%s"]', $name)); |
43 | 43 | if (!$element->getAttribute('for')) { |
44 | - throw new NotFoundException('Unable to find the "for" attribute for a label with the text: ' . $name); |
|
44 | + throw new NotFoundException('Unable to find the "for" attribute for a label with the text: '.$name); |
|
45 | 45 | } |
46 | 46 | $formElement = $this->webDriver->byId($element->getAttribute('for')); |
47 | 47 | } |
@@ -31,10 +31,10 @@ |
||
31 | 31 | |
32 | 32 | public function configureDi(Di $di) |
33 | 33 | { |
34 | - $di->instanceManager()->addSharedInstance($this->configurationReader, get_class($this->configurationReader)); |
|
35 | - $di->instanceManager()->addSharedInstance($this->classConfigurationReader, get_class($this->classConfigurationReader)); |
|
36 | - $di->instanceManager()->addSharedInstance($this->environmentConfigurationReader, get_class($this->environmentConfigurationReader)); |
|
37 | - $di->instanceManager()->addSharedInstance($this, get_class($this)); |
|
34 | + $di->instanceManager()->addSharedInstance($this->configurationReader, get_class($this->configurationReader)); |
|
35 | + $di->instanceManager()->addSharedInstance($this->classConfigurationReader, get_class($this->classConfigurationReader)); |
|
36 | + $di->instanceManager()->addSharedInstance($this->environmentConfigurationReader, get_class($this->environmentConfigurationReader)); |
|
37 | + $di->instanceManager()->addSharedInstance($this, get_class($this)); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function configureObject(ConfigurableObjectInterface $obj) |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | foreach ($classes as $class) { |
14 | 14 | |
15 | - $variablePrefix = 'MAGIUM_' . str_replace('\\', '_', strtoupper($class)) . '_'; |
|
15 | + $variablePrefix = 'MAGIUM_'.str_replace('\\', '_', strtoupper($class)).'_'; |
|
16 | 16 | |
17 | 17 | // Fixes https://github.com/magium/Magium/issues/114 |
18 | 18 | $props = array_merge($_SERVER, $_ENV); |
@@ -96,6 +96,9 @@ discard block |
||
96 | 96 | return $classes; |
97 | 97 | } |
98 | 98 | |
99 | + /** |
|
100 | + * @param string $class |
|
101 | + */ |
|
99 | 102 | protected function processClass($class) |
100 | 103 | { |
101 | 104 | try { |
@@ -137,6 +140,9 @@ discard block |
||
137 | 140 | return null; |
138 | 141 | } |
139 | 142 | |
143 | + /** |
|
144 | + * @param string $file |
|
145 | + */ |
|
140 | 146 | protected function getClassNameInFile($file) |
141 | 147 | { |
142 | 148 | $namespace = $class = ''; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | && $tokens[$i][0] == T_STRING |
151 | 151 | ) { |
152 | 152 | |
153 | - $class = $namespace . $tokens[$i][1]; |
|
153 | + $class = $namespace.$tokens[$i][1]; |
|
154 | 154 | $this->logger->debug(sprintf('Extracted %s from %s', $class, $file)); |
155 | 155 | return $class; |
156 | 156 | } else if ($tokens[$i - 2][0] == T_NAMESPACE |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | && $tokens[$i][0] == T_STRING) { |
159 | 159 | |
160 | 160 | $plus = 0; |
161 | - while ($tokens[$i+$plus] != ';') { |
|
162 | - $token = $tokens[$i+$plus]; |
|
161 | + while ($tokens[$i + $plus] != ';') { |
|
162 | + $token = $tokens[$i + $plus]; |
|
163 | 163 | if ($token[0] == T_STRING) { |
164 | - $namespace .= $token[1] . '\\'; |
|
164 | + $namespace .= $token[1].'\\'; |
|
165 | 165 | } |
166 | 166 | $plus++; |
167 | 167 | } |
@@ -141,7 +141,9 @@ |
||
141 | 141 | { |
142 | 142 | $namespace = $class = ''; |
143 | 143 | $content = file_get_contents($file); |
144 | - if (!$content) return null; |
|
144 | + if (!$content) { |
|
145 | + return null; |
|
146 | + } |
|
145 | 147 | $tokens = token_get_all($content); |
146 | 148 | $count = count($tokens); |
147 | 149 | for ($i = 2; $i < $count; $i++) { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | public function evaluate($string) |
25 | 25 | { |
26 | - $string = '<?php ' . $string; |
|
26 | + $string = '<?php '.$string; |
|
27 | 27 | $comparison1 = $comparison2 = ''; |
28 | 28 | $operator = null; |
29 | 29 | $tokens = token_get_all($string); |
@@ -49,10 +49,14 @@ |
||
49 | 49 | |
50 | 50 | if ($operator === null) { |
51 | 51 | $isTrue = in_array($comparison1, $this->reservedTrue); |
52 | - if ($isTrue) return true; |
|
52 | + if ($isTrue) { |
|
53 | + return true; |
|
54 | + } |
|
53 | 55 | |
54 | 56 | $isFalse = in_array($comparison1, $this->reservedFalse); |
55 | - if ($isFalse) return false; |
|
57 | + if ($isFalse) { |
|
58 | + return false; |
|
59 | + } |
|
56 | 60 | |
57 | 61 | return (boolean)$comparison1; |
58 | 62 | } else { |
@@ -60,6 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | + /** |
|
64 | + * @param string $by |
|
65 | + * @param string $selector |
|
66 | + */ |
|
63 | 67 | public function logFind($by, $selector) |
64 | 68 | { |
65 | 69 | if ($this->logger instanceof Logger) { |
@@ -136,6 +140,9 @@ discard block |
||
136 | 140 | return $element; |
137 | 141 | } |
138 | 142 | |
143 | + /** |
|
144 | + * @param string $selector |
|
145 | + */ |
|
139 | 146 | public function elementExists($selector, $by = 'byId') |
140 | 147 | { |
141 | 148 | try { |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Facebook\WebDriver\Exception\WebDriverException; |
6 | 6 | use Facebook\WebDriver\Remote\DriverCommand; |
7 | 7 | use Facebook\WebDriver\Remote\HttpCommandExecutor; |
8 | -use Facebook\WebDriver\Remote\RemoteExecuteMethod; |
|
9 | 8 | use Facebook\WebDriver\Remote\RemoteWebDriver; |
10 | 9 | use Facebook\WebDriver\Remote\WebDriverCommand; |
11 | 10 | use Facebook\WebDriver\WebDriverBy; |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | $isVendor = array_pop($testParts) == 'vendor'; |
45 | 45 | |
46 | 46 | if ($isVendor) { |
47 | - $path = realpath(__DIR__ . '/../../../../..'); // Get out of the Magium directories |
|
47 | + $path = realpath(__DIR__.'/../../../../..'); // Get out of the Magium directories |
|
48 | 48 | } else { |
49 | - $path = realpath(__DIR__ . '/../../..'); |
|
49 | + $path = realpath(__DIR__.'/../../..'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $count = 0; |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | $classes = $this->introspectClass($config); |
77 | 77 | |
78 | 78 | foreach ($classes as $class) { |
79 | - $configurationFile = $class . '.php'; |
|
80 | - $configurationFile = $configurationDir . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $configurationFile); |
|
79 | + $configurationFile = $class.'.php'; |
|
80 | + $configurationFile = $configurationDir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $configurationFile); |
|
81 | 81 | |
82 | 82 | if (file_exists($configurationFile)) { |
83 | 83 | include $configurationFile; |
@@ -71,7 +71,9 @@ |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
74 | - if (!is_dir($configurationDir)) return; |
|
74 | + if (!is_dir($configurationDir)) { |
|
75 | + return; |
|
76 | + } |
|
75 | 77 | |
76 | 78 | $classes = $this->introspectClass($config); |
77 | 79 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $reflectionClass = $class; |
25 | 25 | } |
26 | 26 | |
27 | - foreach ($originalReflectionClass->getInterfaceNames() as $name){ |
|
27 | + foreach ($originalReflectionClass->getInterfaceNames() as $name) { |
|
28 | 28 | $this->addClass($name); |
29 | 29 | $interfaces[] = $name; |
30 | 30 | $reflectionInterface = new \ReflectionClass($name); |