@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | '@testInitializesItself' => 'setupMock' |
38 | 38 | ]; |
39 | 39 | |
40 | - private $inheritance = [ Fieldset::class, ViewPartialProviderInterface::class, InputFilterProviderInterface::class]; |
|
40 | + private $inheritance = [Fieldset::class, ViewPartialProviderInterface::class, InputFilterProviderInterface::class]; |
|
41 | 41 | |
42 | 42 | private $traits = [ViewPartialProviderTrait::class]; |
43 | 43 | |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | 'name' => [ |
78 | 78 | 'required' => true, |
79 | 79 | 'filters' => [ |
80 | - [ 'name' => 'StringTrim' ], |
|
80 | + ['name' => 'StringTrim'], |
|
81 | 81 | ], |
82 | 82 | ], |
83 | 83 | 'value' => [ |
84 | 84 | 'required' => false, |
85 | 85 | 'filters' => [ |
86 | - [ 'name' => 'StringTrim' ], |
|
86 | + ['name' => 'StringTrim'], |
|
87 | 87 | ], |
88 | 88 | ], |
89 | 89 | ]; |
@@ -51,19 +51,19 @@ |
||
51 | 51 | { |
52 | 52 | $mock = $this->getMockBuilder(AddItemFieldset::class) |
53 | 53 | ->setMethods(['setObject', 'add']) |
54 | - ->disableOriginalConstructor()->getMock(); |
|
54 | + ->disableOriginalConstructor()->getMock(); |
|
55 | 55 | |
56 | 56 | $mock->expects($this->once())->method('setObject')->with($this->isInstanceOf(\ArrayObject::class)); |
57 | 57 | |
58 | 58 | $mock->expects($this->exactly(6))->method('add') |
59 | - ->withConsecutive( |
|
60 | - [['name' => 'id', 'type' => 'Hidden']], |
|
61 | - [['name' => 'current', 'type' => 'Hidden']], |
|
62 | - [['name' => 'do', 'type' => 'Hidden']], |
|
63 | - [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]], |
|
64 | - [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]], |
|
65 | - [['name' => 'priority', 'type' => 'Text']] |
|
66 | - ); |
|
59 | + ->withConsecutive( |
|
60 | + [['name' => 'id', 'type' => 'Hidden']], |
|
61 | + [['name' => 'current', 'type' => 'Hidden']], |
|
62 | + [['name' => 'do', 'type' => 'Hidden']], |
|
63 | + [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]], |
|
64 | + [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]], |
|
65 | + [['name' => 'priority', 'type' => 'Text']] |
|
66 | + ); |
|
67 | 67 | |
68 | 68 | return $mock; |
69 | 69 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | '@testConstruction' => false, |
39 | 39 | ]; |
40 | 40 | |
41 | - private $inheritance = [ AbstractHelper::class ]; |
|
41 | + private $inheritance = [AbstractHelper::class]; |
|
42 | 42 | |
43 | 43 | private function getTargetArgs() |
44 | 44 | { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @throws \Exception |
93 | 93 | * @dataProvider getTestClearCache |
94 | 94 | */ |
95 | - public function testClearCache($cacheDir, $expectThrow=false, $message='Test Cache Directory') |
|
95 | + public function testClearCache($cacheDir, $expectThrow = false, $message = 'Test Cache Directory') |
|
96 | 96 | { |
97 | 97 | $options = $this->getMockBuilder(ListenerOptions::class) |
98 | 98 | ->disableOriginalConstructor() |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | { |
116 | 116 | $cacheDir = sys_get_temp_dir().'/yawik/test-cache'; |
117 | 117 | return [ |
118 | - [null,true,'Test with null cache directory'], |
|
119 | - [sys_get_temp_dir().'/foo',true,'Test with non existent directory'], |
|
120 | - [$cacheDir,false,'Test with valid cache directory'] |
|
118 | + [null, true, 'Test with null cache directory'], |
|
119 | + [sys_get_temp_dir().'/foo', true, 'Test with non existent directory'], |
|
120 | + [$cacheDir, false, 'Test with valid cache directory'] |
|
121 | 121 | ]; |
122 | 122 | } |
123 | 123 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | private $target = [ |
38 | 38 | LanguageRouteListener::class, |
39 | - 'mock' => [ 'detectLanguage' => ['return' => 'xx'], 'setLocale' ], |
|
39 | + 'mock' => ['detectLanguage' => ['return' => 'xx'], 'setLocale'], |
|
40 | 40 | 'args' => 'getConstructorArgs' |
41 | 41 | ]; |
42 | 42 |
@@ -110,8 +110,8 @@ |
||
110 | 110 | $results->push($result1); |
111 | 111 | $this->ajaxEventManagerMock->expects($this->once())->method('getEvent')->with('test', $this->target)->willReturn(new AjaxEvent()); |
112 | 112 | $this->ajaxEventManagerMock->expects($this->once())->method('triggerEventUntil') |
113 | - ->with($this->isInstanceOf('\Closure'), $this->isInstanceOf(AjaxEvent::class)) |
|
114 | - ->willReturn($results); |
|
113 | + ->with($this->isInstanceOf('\Closure'), $this->isInstanceOf(AjaxEvent::class)) |
|
114 | + ->willReturn($results); |
|
115 | 115 | |
116 | 116 | $response = $this->target->onRoute($event); |
117 | 117 |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | '@testConstruction' => false, |
41 | 41 | '@testInheritance' => '@testUsesTraits', |
42 | 42 | '@testDefaultAttributes' => '@testUsesTraits', |
43 | - '@testUsesTraits' => [ 'as_reflection' => true ], |
|
43 | + '@testUsesTraits' => ['as_reflection' => true], |
|
44 | 44 | ]; |
45 | 45 | |
46 | - private $traits = [ ListenerAggregateTrait::class ]; |
|
46 | + private $traits = [ListenerAggregateTrait::class]; |
|
47 | 47 | |
48 | 48 | private $attributes = [ |
49 | - 'events' => [ [ MvcEvent::EVENT_ROUTE, 'onRoute', 100 ] ], |
|
49 | + 'events' => [[MvcEvent::EVENT_ROUTE, 'onRoute', 100]], |
|
50 | 50 | ]; |
51 | 51 | |
52 | 52 | private function getTargetArgs() |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->ajaxEventManagerMock = $this->getMockBuilder(EventManager::class)->disableOriginalConstructor() |
55 | 55 | ->setMethods(['getEvent', 'triggerEventUntil'])->getMock(); |
56 | 56 | |
57 | - return [ $this->ajaxEventManagerMock ]; |
|
57 | + return [$this->ajaxEventManagerMock]; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function testConstruction() |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected $target = '\Core\EventManager\EventManager'; |
33 | 33 | |
34 | - protected $inheritance = [ '\Zend\EventManager\EventManager', '\Core\EventManager\EventProviderInterface' ]; |
|
34 | + protected $inheritance = ['\Zend\EventManager\EventManager', '\Core\EventManager\EventProviderInterface']; |
|
35 | 35 | |
36 | 36 | public function testSetEventPrototype() |
37 | 37 | { |
@@ -44,23 +44,23 @@ discard block |
||
44 | 44 | { |
45 | 45 | $testTarget = new \stdClass(); |
46 | 46 | $testTarget2 = new \stdClass(); |
47 | - $testParams1 = [ 'params1' => 'value1' ]; |
|
48 | - $testParams2 = [ 'name' => 'test6', 'param2' => 'value2' ]; |
|
49 | - $testParams3 = [ 'name' => 'test8', 'target' => $testTarget, 'param3' => 'value3' ]; |
|
50 | - $expect2 = [ 'param2' => 'value2' ]; |
|
51 | - $expect3 = [ 'param3' => 'value3' ]; |
|
47 | + $testParams1 = ['params1' => 'value1']; |
|
48 | + $testParams2 = ['name' => 'test6', 'param2' => 'value2']; |
|
49 | + $testParams3 = ['name' => 'test8', 'target' => $testTarget, 'param3' => 'value3']; |
|
50 | + $expect2 = ['param2' => 'value2']; |
|
51 | + $expect3 = ['param3' => 'value3']; |
|
52 | 52 | |
53 | 53 | return [ |
54 | - [ 'test1', null, [], [ 'name' => 'test1', 'target' => null, 'params' => []]], |
|
55 | - [ 'test2', $testTarget, [], [ 'name' => 'test2', 'target' => $testTarget, 'params' => []]], |
|
56 | - [ 'test3', null, $testParams1, [ 'name' => 'test3', 'target' => null, 'params' => $testParams1]], |
|
57 | - 'setParamsAsFirstArg' => [ $testParams1, null, ['ignoreme' => 'yes' ], [ 'name' => null, 'target' => null, 'params' => $testParams1 ]], |
|
58 | - 'setParamsAsSecondArg' => [ 'test5', $testParams1, ['ignoreme' => 'yes' ], ['name' => 'test5', 'target' => null, 'params' => $testParams1 ]], |
|
59 | - 'setNameInParamsAsFirstArg' => [ $testParams2, null, [], [ 'name' => 'test6', 'target' => null, 'params' => $expect2]], |
|
60 | - 'setNameInParamsAsFirstArgAndTarget' => [ $testParams2, $testTarget, ['ignoreme' => 'yes'], [ 'name' => 'test6', 'target' => $testTarget, 'params' => $expect2]], |
|
61 | - 'setNameAndTargetInParams' => [ $testParams3, null, [], [ 'name' => 'test8', 'target' => $testTarget, 'params' => $expect3]], |
|
62 | - [ 'test9', $testTarget2, $testParams3, ['name' => 'test9', 'target' => $testTarget2, 'params' => $testParams3 ]], |
|
63 | - [ null, $testParams2, [], ['name' => 'test6', 'target' => null, 'params' => $expect2 ]], |
|
54 | + ['test1', null, [], ['name' => 'test1', 'target' => null, 'params' => []]], |
|
55 | + ['test2', $testTarget, [], ['name' => 'test2', 'target' => $testTarget, 'params' => []]], |
|
56 | + ['test3', null, $testParams1, ['name' => 'test3', 'target' => null, 'params' => $testParams1]], |
|
57 | + 'setParamsAsFirstArg' => [$testParams1, null, ['ignoreme' => 'yes'], ['name' => null, 'target' => null, 'params' => $testParams1]], |
|
58 | + 'setParamsAsSecondArg' => ['test5', $testParams1, ['ignoreme' => 'yes'], ['name' => 'test5', 'target' => null, 'params' => $testParams1]], |
|
59 | + 'setNameInParamsAsFirstArg' => [$testParams2, null, [], ['name' => 'test6', 'target' => null, 'params' => $expect2]], |
|
60 | + 'setNameInParamsAsFirstArgAndTarget' => [$testParams2, $testTarget, ['ignoreme' => 'yes'], ['name' => 'test6', 'target' => $testTarget, 'params' => $expect2]], |
|
61 | + 'setNameAndTargetInParams' => [$testParams3, null, [], ['name' => 'test8', 'target' => $testTarget, 'params' => $expect3]], |
|
62 | + ['test9', $testTarget2, $testParams3, ['name' => 'test9', 'target' => $testTarget2, 'params' => $testParams3]], |
|
63 | + [null, $testParams2, [], ['name' => 'test6', 'target' => null, 'params' => $expect2]], |
|
64 | 64 | |
65 | 65 | ]; |
66 | 66 | } |
@@ -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 |
@@ -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 |
@@ -40,18 +40,18 @@ |
||
40 | 40 | */ |
41 | 41 | public function testInheritance() |
42 | 42 | { |
43 | - $errTmpl = __TRAIT__ . ': ' . get_class($this); |
|
43 | + $errTmpl = __TRAIT__.': '.get_class($this); |
|
44 | 44 | |
45 | 45 | if (!property_exists($this, 'inheritance') || !property_exists($this, 'target')) { |
46 | - throw new \PHPUnit_Framework_Exception($errTmpl . ' must define the properties "$inheritance" and "$target"'); |
|
46 | + throw new \PHPUnit_Framework_Exception($errTmpl.' must define the properties "$inheritance" and "$target"'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | if (!is_array($this->inheritance)) { |
50 | - throw new \PHPUnit_Framework_Exception($errTmpl . ': Property $inheritance must be an array'); |
|
50 | + throw new \PHPUnit_Framework_Exception($errTmpl.': Property $inheritance must be an array'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if (!is_object($this->target)) { |
54 | - throw new \PHPUnit_Framework_Exception($errTmpl . ': Property $target must be an object'); |
|
54 | + throw new \PHPUnit_Framework_Exception($errTmpl.': Property $target must be an object'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $this->assertInheritance($this->inheritance, $this->target); |