@@ -54,8 +54,8 @@ |
||
54 | 54 | |
55 | 55 | if (!is_array($defaultAttributes)) { |
56 | 56 | throw \PHPUnit_Util_InvalidArgumentHelper::factory( |
57 | - 1, |
|
58 | - 'array or ArrayAccess' |
|
57 | + 1, |
|
58 | + 'array or ArrayAccess' |
|
59 | 59 | ); |
60 | 60 | } |
61 | 61 |
@@ -21,14 +21,14 @@ |
||
21 | 21 | if (!is_object($object)) { |
22 | 22 | throw new \InvalidArgumentException('Data Provider first argument should be an object'); |
23 | 23 | } |
24 | - $setter = 'set' . $propertyName; |
|
25 | - $getter = 'get' . $propertyName; |
|
24 | + $setter = 'set'.$propertyName; |
|
25 | + $getter = 'get'.$propertyName; |
|
26 | 26 | |
27 | 27 | call_user_func(array($object, $setter), $propertyValue); |
28 | 28 | $this->assertSame( |
29 | 29 | $propertyValue, |
30 | 30 | call_user_func(array($object, $getter)), |
31 | - '::' . $setter . '() and ::' . $getter . '() should executed properly' |
|
31 | + '::'.$setter.'() and ::'.$getter.'() should executed properly' |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | if (!property_exists($this, 'target') || !is_object($this->target)) { |
45 | 45 | throw new \PHPUnit_Framework_Exception( |
46 | - self::class . ': ' . static::class |
|
46 | + self::class.': '.static::class |
|
47 | 47 | . ' must define the property $target and its value must be an object.'); |
48 | 48 | } |
49 | 49 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if (!is_array($attributes)) { |
54 | 54 | throw new \PHPUnit_Framework_Exception( |
55 | - self::class . ': ' . static::class . ': Invalid format of attributes. Must be an array of attribute => value pairs.' |
|
55 | + self::class.': '.static::class.': Invalid format of attributes. Must be an array of attribute => value pairs.' |
|
56 | 56 | ); |
57 | 57 | } |
58 | 58 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | if (!property_exists($this, 'attributes')) { |
65 | 65 | throw new \PHPUnit_Framework_Exception( |
66 | - self::class . ': ' . static::class |
|
66 | + self::class.': '.static::class |
|
67 | 67 | . ' must define the property $attributes with an array of attribute => value pairs.'); |
68 | 68 | } |
69 | 69 |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function createPluginManagerMock($services = [], $parent = null, $count = 1) |
107 | 107 | { |
108 | - if(is_null($parent)){ |
|
109 | - $parent = $this->getServiceManagerMock(); |
|
110 | - } |
|
111 | - $arrConfig = array(); |
|
108 | + if(is_null($parent)){ |
|
109 | + $parent = $this->getServiceManagerMock(); |
|
110 | + } |
|
111 | + $arrConfig = array(); |
|
112 | 112 | if (is_array($services)) { |
113 | 113 | $config = new ServiceManagerMockConfig(['mocks' => $services]); |
114 | 114 | } else { |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | |
120 | 120 | $pluginManagerMock = new PluginManagerMock($parent); |
121 | 121 | if($config instanceof ServiceManagerMockConfig){ |
122 | - $config->configureServiceManager($pluginManagerMock); |
|
122 | + $config->configureServiceManager($pluginManagerMock); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | //@TODO: [ZF3] Check if removing the lines below is safe |
126 | - //if (null !== $parent) { |
|
126 | + //if (null !== $parent) { |
|
127 | 127 | // $pluginManagerMock->setServiceLocator($parent, $count); |
128 | 128 | //} |
129 | 129 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function createPluginManagerMock($services = [], $parent = null, $count = 1) |
107 | 107 | { |
108 | - if(is_null($parent)){ |
|
108 | + if (is_null($parent)) { |
|
109 | 109 | $parent = $this->getServiceManagerMock(); |
110 | 110 | } |
111 | 111 | $arrConfig = array(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | $pluginManagerMock = new PluginManagerMock($parent); |
121 | - if($config instanceof ServiceManagerMockConfig){ |
|
121 | + if ($config instanceof ServiceManagerMockConfig) { |
|
122 | 122 | $config->configureServiceManager($pluginManagerMock); |
123 | 123 | } |
124 | 124 |
@@ -54,8 +54,8 @@ |
||
54 | 54 | |
55 | 55 | if (!is_array($parentsAndInterfaces)) { |
56 | 56 | throw \PHPUnit_Util_InvalidArgumentHelper::factory( |
57 | - 1, |
|
58 | - 'array or ArrayAccess' |
|
57 | + 1, |
|
58 | + 'array or ArrayAccess' |
|
59 | 59 | ); |
60 | 60 | } |
61 | 61 |
@@ -25,24 +25,24 @@ |
||
25 | 25 | { |
26 | 26 | /* @var $this \PHPUnit_Framework_TestCase */ |
27 | 27 | |
28 | - $getter = 'get' . $propName; |
|
28 | + $getter = 'get'.$propName; |
|
29 | 29 | if (is_object($expectedValue)) { |
30 | 30 | $this->assertInstanceOf( |
31 | 31 | get_class($expectedValue), |
32 | 32 | $object->$getter(), |
33 | - '::' . $getter . '() init value should return a type of ' . get_class($expectedValue) |
|
33 | + '::'.$getter.'() init value should return a type of '.get_class($expectedValue) |
|
34 | 34 | ); |
35 | 35 | } elseif (is_array($expectedValue)) { |
36 | 36 | $this->assertSame( |
37 | 37 | $expectedValue, |
38 | 38 | $object->$getter(), |
39 | - '::' . $getter . '() init value should return an empty array' |
|
39 | + '::'.$getter.'() init value should return an empty array' |
|
40 | 40 | ); |
41 | 41 | } else { |
42 | 42 | $this->assertEquals( |
43 | 43 | $expectedValue, |
44 | 44 | $object->$getter(), |
45 | - '::' . $getter . '() init value should return ' . $expectedValue |
|
45 | + '::'.$getter.'() init value should return '.$expectedValue |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $errTmpl = __METHOD__ . ': ' . get_class($this); |
185 | 185 | if (!property_exists($this, 'target') || (!is_object($this->target) && !isset($spec['target']))) { |
186 | 186 | throw new \PHPUnit_Framework_Exception($errTmpl |
187 | - . ' must define the property "target" and the value must be an object.'); |
|
187 | + . ' must define the property "target" and the value must be an object.'); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | if (!is_array($spec)) { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | if (isset($spec['setter_exception'])) { |
236 | 236 | $this->_setterGetter_assertSetterGetterException($setterMethod, $spec['setter_exception'], $spec['value'], |
237 | - $setterArgs |
|
237 | + $setterArgs |
|
238 | 238 | ); |
239 | 239 | |
240 | 240 | return; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | if (!isset($spec['ignore_setter']) || !$spec['ignore_setter']) { |
251 | 251 | $assert = isset($spec['setter_assert']) ? $spec['setter_assert'] : null; |
252 | 252 | $this->_setterGetter_assertSetterValue($setterMethod, $spec['value'], $setterArgs, $assert, |
253 | - array_key_exists('setter_value', $spec) |
|
253 | + array_key_exists('setter_value', $spec) |
|
254 | 254 | ? $spec['setter_value'] |
255 | 255 | : '__FLUENT_INTERFACE__' |
256 | 256 | ); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | if (isset($spec['getter_exception'])) { |
260 | 260 | $this->_setterGetter_assertSetterGetterException($getterMethod, $spec['getter_exception'], '__GETTER_EXCEPTION__', |
261 | - $getterArgs |
|
261 | + $getterArgs |
|
262 | 262 | ); |
263 | 263 | |
264 | 264 | return; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } else if (!isset($spec['ignore_getter']) || !$spec['ignore_getter']) { |
272 | 272 | $assert = isset($spec['getter_assert']) ? $spec['getter_assert'] : null; |
273 | 273 | $this->_setterGetter_assertGetterValue($getterMethod, array_key_exists('expect', $spec) ? $spec['expect'] : $spec['value'], |
274 | - $getterArgs, $assert |
|
274 | + $getterArgs, $assert |
|
275 | 275 | ); |
276 | 276 | } |
277 | 277 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } |
382 | 382 | |
383 | 383 | $err = __TRAIT__ . ': ' . get_class($this) . ': Setter ' . get_class($this->target) . '::' . $setter |
384 | - . ($expect === $this->target ? ' breaks fluent interface.' : ' does not return expected value.'); |
|
384 | + . ($expect === $this->target ? ' breaks fluent interface.' : ' does not return expected value.'); |
|
385 | 385 | |
386 | 386 | |
387 | 387 | if (false === $args) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function testSetterAndGetter($name, $spec) |
183 | 183 | { |
184 | - $errTmpl = __METHOD__ . ': ' . get_class($this); |
|
184 | + $errTmpl = __METHOD__.': '.get_class($this); |
|
185 | 185 | if (!property_exists($this, 'target') || (!is_object($this->target) && !isset($spec['target']))) { |
186 | 186 | throw new \PHPUnit_Framework_Exception($errTmpl |
187 | 187 | . ' must define the property "target" and the value must be an object.'); |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | } else if (isset($spec['value']) && is_string($spec['value']) && 0 === strpos($spec['value'], '@')) { |
197 | 197 | $spec['value'] = InstanceCreator::newClass($spec['value']); |
198 | 198 | } else if (isset($spec['value@'])) { |
199 | - $spec['value'] = '@' . $spec['value@']; |
|
199 | + $spec['value'] = '@'.$spec['value@']; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | /* Value could be 'null', so we need to use array_key_exists here. */ |
203 | 203 | if (!array_key_exists('value', $spec)) { |
204 | 204 | if (!array_key_exists('default', $spec) && !array_key_exists('@default', $spec) && !array_key_exists('default@', $spec)) { |
205 | - throw new \PHPUnit_Framework_Exception($errTmpl . ': Specification must contain the key "value" or "default".'); |
|
205 | + throw new \PHPUnit_Framework_Exception($errTmpl.': Specification must contain the key "value" or "default".'); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | $spec['value'] = null; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $spec['default'] = InstanceCreator::fromSpec($spec['@default'], InstanceCreator::FORCE_INSTANTIATION); |
221 | 221 | |
222 | 222 | } else if (isset($spec['default@'])) { |
223 | - $spec['default'] = '@' . $spec['default@']; |
|
223 | + $spec['default'] = '@'.$spec['default@']; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | */ |
320 | 320 | private function _setterGetter_assertGetterValue($getter, $value, $args, $assert, $isDefaultValue = false) |
321 | 321 | { |
322 | - $err = sprintf( |
|
322 | + $err = sprintf( |
|
323 | 323 | '%s: %s: %s for %s::%s is not as expected', |
324 | 324 | __TRAIT__, get_class($this), $isDefaultValue ? 'Default value' : 'Value', get_class($this->target), $getter |
325 | 325 | ); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | break; |
350 | 350 | |
351 | 351 | case "boolean": |
352 | - $method = 'assert' . ($value ? 'True' : 'False'); |
|
352 | + $method = 'assert'.($value ? 'True' : 'False'); |
|
353 | 353 | $this->$method($returned, $err); |
354 | 354 | break; |
355 | 355 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $expect = $this->target; |
381 | 381 | } |
382 | 382 | |
383 | - $err = __TRAIT__ . ': ' . get_class($this) . ': Setter ' . get_class($this->target) . '::' . $setter |
|
383 | + $err = __TRAIT__.': '.get_class($this).': Setter '.get_class($this->target).'::'.$setter |
|
384 | 384 | . ($expect === $this->target ? ' breaks fluent interface.' : ' does not return expected value.'); |
385 | 385 | |
386 | 386 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | break; |
411 | 411 | |
412 | 412 | case "boolean": |
413 | - $method = 'assert' . ($expect ? 'True' : 'False'); |
|
413 | + $method = 'assert'.($expect ? 'True' : 'False'); |
|
414 | 414 | $this->$method($returned, $err); |
415 | 415 | break; |
416 | 416 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | */ |
430 | 430 | private function _setterGetter_assertPropertyValue($name, $value, $assert) |
431 | 431 | { |
432 | - $err = __TRAIT__ . ': ' . get_class($this) . ': Property ' . $name . ' does not have expected value.'; |
|
432 | + $err = __TRAIT__.': '.get_class($this).': Property '.$name.' does not have expected value.'; |
|
433 | 433 | |
434 | 434 | $propertyName = $name; |
435 | 435 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | if (!is_callable($method)) { |
489 | 489 | $method = [$this, $method]; |
490 | 490 | if (!is_callable($method)) { |
491 | - throw new \UnexpectedValueException('Invalid callback for "' . $type . '" hook.'); |
|
491 | + throw new \UnexpectedValueException('Invalid callback for "'.$type.'" hook.'); |
|
492 | 492 | } |
493 | 493 | } |
494 | 494 | $cb = $method; |
@@ -500,12 +500,12 @@ discard block |
||
500 | 500 | } |
501 | 501 | |
502 | 502 | if (false === $args) { |
503 | - $args = [ $spec ]; |
|
503 | + $args = [$spec]; |
|
504 | 504 | |
505 | 505 | } else { |
506 | 506 | |
507 | 507 | $args = array_map( |
508 | - function ($item) use ($spec) { |
|
508 | + function($item) use ($spec) { |
|
509 | 509 | if ('###' == $item) { |
510 | 510 | return $spec; |
511 | 511 | } |
@@ -274,7 +274,7 @@ |
||
274 | 274 | : (isset($methodSpec['return']) |
275 | 275 | ? ('__self__' === $methodSpec['return'] ? $this->returnSelf() : $this->returnValue($methodSpec['return'])) |
276 | 276 | : null |
277 | - ), |
|
277 | + ), |
|
278 | 278 | ]; |
279 | 279 | } |
280 | 280 | } |
@@ -129,15 +129,15 @@ discard block |
||
129 | 129 | $testName = array_shift($testNameParts); |
130 | 130 | $testSet = trim(array_pop($testNameParts), '"'); |
131 | 131 | |
132 | - $testNameKey = '@' . $testName; |
|
133 | - $testNameSetKey = $testNameKey . '|' . $testSet; |
|
132 | + $testNameKey = '@'.$testName; |
|
133 | + $testNameSetKey = $testNameKey.'|'.$testSet; |
|
134 | 134 | $testSpec = isset($spec[$testNameKey]) ? $spec[$testNameKey] : (isset($spec[$testNameSetKey]) ? $spec[$testNameSetKey] : null); |
135 | 135 | |
136 | 136 | if (null === $testSpec) { |
137 | 137 | foreach (array_keys($spec) as $testSpecPattern) { |
138 | 138 | if (false === strpos($testSpecPattern, '*')) { continue; } |
139 | 139 | |
140 | - if (preg_match('~^' . str_replace('*', '.*', substr($testSpecPattern, 1)) . '~', $testName)) { |
|
140 | + if (preg_match('~^'.str_replace('*', '.*', substr($testSpecPattern, 1)).'~', $testName)) { |
|
141 | 141 | $testSpec = $spec[$testSpecPattern]; |
142 | 142 | break; |
143 | 143 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if (isset($spec[$testSpec])) { |
155 | 155 | $testSpec = $spec[$testSpec]; |
156 | 156 | } else if (class_exists($testSpec)) { |
157 | - $testSpec = [ $testSpec ]; |
|
157 | + $testSpec = [$testSpec]; |
|
158 | 158 | } else { |
159 | 159 | $this->target = $this->{$testSpec}(); |
160 | 160 | return; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | if (!isset($spec['class'])) { |
187 | 187 | if (!isset($spec[0])) { |
188 | - throw new \PHPUnit_Framework_Exception(__TRAIT__ . ': No target class name specified.'); |
|
188 | + throw new \PHPUnit_Framework_Exception(__TRAIT__.': No target class name specified.'); |
|
189 | 189 | } |
190 | 190 | $spec['class'] = $spec[0]; |
191 | 191 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | }; |
259 | 259 | |
260 | 260 | $methods = []; |
261 | - $methodMocks = []; |
|
261 | + $methodMocks = []; |
|
262 | 262 | |
263 | 263 | if (is_array($spec)) { |
264 | 264 | foreach ($spec as $method => $methodSpec) { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | if (!property_exists($this, 'traits') || !property_exists($this, 'target')) { |
37 | 37 | throw new \PHPUnit_Framework_Exception(self::class . ': ' . static::class |
38 | - . ' must define the properties $target and $traits.'); |
|
38 | + . ' must define the properties $target and $traits.'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->assertUsesTraits($this->traits, $this->target); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function testUsesTraits() |
35 | 35 | { |
36 | 36 | if (!property_exists($this, 'traits') || !property_exists($this, 'target')) { |
37 | - throw new \PHPUnit_Framework_Exception(self::class . ': ' . static::class |
|
37 | + throw new \PHPUnit_Framework_Exception(self::class.': '.static::class |
|
38 | 38 | . ' must define the properties $target and $traits.'); |
39 | 39 | } |
40 | 40 |