X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FHooksTest.php;h=74d4b09131f7d67c888dc57985fee81e01650772;hb=2d9d5fecf334264bcba05ad9624a377dfc29c067;hp=87af6c1f3bff2b3cfdfd75fbdd77c0d0ceaa27cc;hpb=27e4a897a2f094b9a0534cff08c3da8be0ee7e33;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php index 87af6c1f3b..74d4b09131 100644 --- a/tests/phpunit/includes/HooksTest.php +++ b/tests/phpunit/includes/HooksTest.php @@ -13,11 +13,26 @@ class HooksTest extends MediaWikiTestCase { $i = new NothingClass(); return array( - array( 'Object and method', array( $i, 'someNonStatic' ), 'changed-nonstatic', 'changed-nonstatic' ), + array( + 'Object and method', + array( $i, 'someNonStatic' ), + 'changed-nonstatic', + 'changed-nonstatic' + ), array( 'Object and no method', array( $i ), 'changed-onevent', 'original' ), - array( 'Object and method with data', array( $i, 'someNonStaticWithData', 'data' ), 'data', 'original' ), + array( + 'Object and method with data', + array( $i, 'someNonStaticWithData', 'data' ), + 'data', + 'original' + ), array( 'Object and static method', array( $i, 'someStatic' ), 'changed-static', 'original' ), - array( 'Class::method static call', array( 'NothingClass::someStatic' ), 'changed-static', 'original' ), + array( + 'Class::method static call', + array( 'NothingClass::someStatic' ), + 'changed-static', + 'original' + ), array( 'Global function', array( 'NothingFunction' ), 'changed-func', 'original' ), array( 'Global function with data', array( 'NothingFunctionData', 'data' ), 'data', 'original' ), array( 'Closure', array( function ( &$foo, $bar ) { @@ -76,17 +91,32 @@ class HooksTest extends MediaWikiTestCase { $b = new NothingClass(); $wgHooks['MediaWikiHooksTest001'][] = $a; - $this->assertTrue( Hooks::isRegistered( 'MediaWikiHooksTest001' ), 'Hook registered via $wgHooks should be noticed by Hooks::isRegistered' ); + $this->assertTrue( + Hooks::isRegistered( 'MediaWikiHooksTest001' ), + 'Hook registered via $wgHooks should be noticed by Hooks::isRegistered' + ); Hooks::register( 'MediaWikiHooksTest001', $b ); - $this->assertEquals( 2, count( Hooks::getHandlers( 'MediaWikiHooksTest001' ) ), 'Hooks::getHandlers() should return hooks registered via wgHooks as well as Hooks::register' ); + $this->assertEquals( + 2, + count( Hooks::getHandlers( 'MediaWikiHooksTest001' ) ), + 'Hooks::getHandlers() should return hooks registered via wgHooks as well as Hooks::register' + ); $foo = 'quux'; $bar = 'qaax'; Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) ); - $this->assertEquals( 1, $a->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); - $this->assertEquals( 1, $b->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); + $this->assertEquals( + 1, + $a->calls, + 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' + ); + $this->assertEquals( + 1, + $b->calls, + 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' + ); } /**