@@ -50,8 +50,8 @@ public function hookTestString_2($input)
50
50
*/
51
51
public function testHooks ()
52
52
{
53
- $ this ->hooks ->add_filter ('test_strict ' , array ( $ this , 'hookTestString_1 ' ) );
54
- $ this ->hooks ->add_filter ('test_strict ' , array ( $ this , 'hookTestString_2 ' ) );
53
+ $ this ->hooks ->add_filter ('test_strict ' , [ $ this , 'hookTestString_1 ' ] );
54
+ $ this ->hooks ->add_filter ('test_strict ' , [ $ this , 'hookTestString_2 ' ] );
55
55
56
56
$ lall = $ this ->hooks ->apply_filters ('test_strict ' , '' );
57
57
@@ -67,7 +67,7 @@ public function testHooksInstance()
67
67
{
68
68
$ lall = $ this ->hooks ->apply_filters ('test_strict ' , '' );
69
69
70
- self ::assertSame ($ this ->testString_1 . $ this ->testString_2 , $ lall, );
70
+ self ::assertSame ($ this ->testString_1 . $ this ->testString_2 , $ lall );
71
71
}
72
72
73
73
public function testHasFunctions ()
@@ -163,34 +163,34 @@ public function testRunHookFunctions()
163
163
self ::assertSame (true , $ hooks ->remove_all_actions ('testAction ' ));
164
164
165
165
self ::assertSame (false , $ hooks ->do_action ('testAction ' ));
166
- self ::assertSame (false , $ hooks ->do_action_ref_array ('testNotExistingAction ' , array () ));
166
+ self ::assertSame (false , $ hooks ->do_action_ref_array ('testNotExistingAction ' , [] ));
167
167
self ::assertSame ('Foo ' , $ hooks ->apply_filters ('testFilter ' , 'Foo ' ));
168
168
169
- self ::assertSame (false , $ hooks ->do_action_ref_array ('testAction ' , array ( 'test ' ) ));
170
- self ::assertSame ('Foo ' , $ hooks ->apply_filters_ref_array ('testFilter ' , array ( 'Foo ' ) ));
169
+ self ::assertSame (false , $ hooks ->do_action_ref_array ('testAction ' , [ 'test ' ] ));
170
+ self ::assertSame ('Foo ' , $ hooks ->apply_filters_ref_array ('testFilter ' , [ 'Foo ' ] ));
171
171
172
- $ mock = $ this ->getMockBuilder ('stdClass ' )->setMethods ( array ( 'doSomeAction ' , 'applySomeFilter ' ) )->getMock ();
172
+ $ mock = $ this ->getMockBuilder ('stdClass ' )->setMethods ([ 'doSomeAction ' , 'applySomeFilter ' ] )->getMock ();
173
173
$ mock ->expects (self ::exactly (4 ))->method ('doSomeAction ' );
174
174
$ mock ->expects (self ::exactly (10 ))->method ('applySomeFilter ' )->willReturn ('foo ' );
175
175
176
- self ::assertSame (true , $ hooks ->add_action ('testAction ' , array ( $ mock , 'doSomeAction ' ) ));
177
- self ::assertSame (true , $ hooks ->add_filter ('testFilter ' , array ( $ mock , 'applySomeFilter ' ) ));
176
+ self ::assertSame (true , $ hooks ->add_action ('testAction ' , [ $ mock , 'doSomeAction ' ] ));
177
+ self ::assertSame (true , $ hooks ->add_filter ('testFilter ' , [ $ mock , 'applySomeFilter ' ] ));
178
178
179
179
self ::assertSame (2 , $ hooks ->did_action ('testAction ' ));
180
180
self ::assertSame (true , $ hooks ->do_action ('testAction ' ));
181
181
self ::assertSame (3 , $ hooks ->did_action ('testAction ' ));
182
182
self ::assertSame ('foo ' , $ hooks ->apply_filters ('testFilter ' , 'Foo ' ));
183
183
184
- self ::assertSame (true , $ hooks ->add_filter ('all ' , array ( $ mock , 'applySomeFilter ' ) ));
184
+ self ::assertSame (true , $ hooks ->add_filter ('all ' , [ $ mock , 'applySomeFilter ' ] ));
185
185
186
186
self ::assertSame (false , $ hooks ->do_action ('notExistingAction ' ));
187
187
self ::assertSame ('Foo ' , $ hooks ->apply_filters ('notExistingFilter ' , 'Foo ' )); // unmodified value
188
188
189
- self ::assertSame (true , $ hooks ->do_action ('testAction ' , (object )array ( 'foo ' => 'bar ' ) ));
189
+ self ::assertSame (true , $ hooks ->do_action ('testAction ' , (object )[ 'foo ' => 'bar ' ] ));
190
190
self ::assertSame (true , $ hooks ->do_action ('testAction ' , 'param1 ' , 'param2 ' , 'param3 ' , 'param4 ' ));
191
- self ::assertSame (true , $ hooks ->do_action_ref_array ('testAction ' , array ( 'test ' ) ));
191
+ self ::assertSame (true , $ hooks ->do_action_ref_array ('testAction ' , [ 'test ' ] ));
192
192
self ::assertSame ('foo ' , $ hooks ->apply_filters ('testFilter ' , 'Foo ' ));
193
- self ::assertSame ('foo ' , $ hooks ->apply_filters_ref_array ('testFilter ' , array ( 'Foo ' ) ));
193
+ self ::assertSame ('foo ' , $ hooks ->apply_filters_ref_array ('testFilter ' , [ 'Foo ' ] ));
194
194
}
195
195
196
196
public function testRunShortcodeFunctions ()
@@ -204,7 +204,7 @@ public function testRunShortcodeFunctions()
204
204
self ::assertSame ('testAction ' , $ hooks ->do_shortcode ('testAction ' ));
205
205
206
206
$ testClass = new HooksFooBar ();
207
- self ::assertSame (true , $ hooks ->add_shortcode ('testAction ' , array ( $ testClass , 'doSomethingFunction ' ) ));
207
+ self ::assertSame (true , $ hooks ->add_shortcode ('testAction ' , [ $ testClass , 'doSomethingFunction ' ] ));
208
208
self ::assertTrue ($ hooks ->shortcode_exists ('testAction ' ));
209
209
210
210
self ::assertSame ('foo bar <li class="">content</li> ' , $ hooks ->do_shortcode ('foo bar [testAction foo="bar"]content[/testAction] ' ));
0 commit comments