19eae81e2ae170f1eae42e11a10e4db88fa41fca
[lhc/web/wiklou.git] / tests / phpunit / includes / MWFunctionTest.php
1 <?php
2
3 class MWFunctionTest extends MediaWikiTestCase {
4
5 function testCallUserFuncWorkarounds() {
6
7 $this->assertEquals(
8 MWFunction::call( 'MWFunctionTest::someMethod' ),
9 call_user_func( array( 'MWFunctionTest', 'someMethod' ) )
10 );
11 $this->assertEquals(
12 MWFunction::call( 'MWFunctionTest::someMethod', 'foo', 'bar', 'baz' ),
13 call_user_func( array( 'MWFunctionTest', 'someMethod' ), 'foo', 'bar', 'baz' )
14 );
15
16
17
18 $this->assertEquals(
19 MWFunction::callArray( 'MWFunctionTest::someMethod', array() ),
20 call_user_func_array( array( 'MWFunctionTest', 'someMethod' ), array() )
21 );
22 $this->assertEquals(
23 MWFunction::callArray( 'MWFunctionTest::someMethod', array( 'foo', 'bar', 'baz' ) ),
24 call_user_func_array( array( 'MWFunctionTest', 'someMethod' ), array( 'foo', 'bar', 'baz' ) )
25 );
26
27 }
28
29 public static function someMethod() {
30 return func_get_args();
31 }
32
33 }
34