MediaWiki  1.23.13
wfGetCallerTest.php
Go to the documentation of this file.
1 <?php
2 
7 
8  public function testZero() {
9  $this->assertEquals( __METHOD__, wfGetCaller( 1 ) );
10  }
11 
12  function callerOne() {
13  return wfGetCaller();
14  }
15 
16  public function testOne() {
17  $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() );
18  }
19 
20  function intermediateFunction( $level = 2, $n = 0 ) {
21  if ( $n > 0 ) {
22  return self::intermediateFunction( $level, $n - 1 );
23  }
24 
25  return wfGetCaller( $level );
26  }
27 
28  public function testTwo() {
29  $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() );
30  }
31 
32  public function testN() {
33  $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) );
34  $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) );
35 
36  for ( $i = 0; $i < 10; $i++ ) {
37  $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( $i + 1, $i ) );
38  }
39  }
40 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$n
$n
Definition: RandomTest.php:76
WfGetCallerTest
@covers wfGetCaller
Definition: wfGetCallerTest.php:6
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
WfGetCallerTest\callerOne
callerOne()
Definition: wfGetCallerTest.php:12
WfGetCallerTest\testZero
testZero()
Definition: wfGetCallerTest.php:8
WfGetCallerTest\testN
testN()
Definition: wfGetCallerTest.php:32
WfGetCallerTest\testTwo
testTwo()
Definition: wfGetCallerTest.php:28
WfGetCallerTest\intermediateFunction
intermediateFunction( $level=2, $n=0)
Definition: wfGetCallerTest.php:20
WfGetCallerTest\testOne
testOne()
Definition: wfGetCallerTest.php:16
wfGetCaller
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
Definition: GlobalFunctions.php:1988