Merge "Displaying protection expiry date and time in action=info"
[lhc/web/wiklou.git] / tests / phpunit / includes / utils / MWFunctionTest.php
1 <?php
2
3 /**
4 * @covers MWFunction
5 */
6 class MWFunctionTest extends MediaWikiTestCase {
7 public function testNewObjFunction() {
8 $arg1 = 'Foo';
9 $arg2 = 'Bar';
10 $arg3 = array( 'Baz' );
11 $arg4 = new ExampleObject;
12
13 $args = array( $arg1, $arg2, $arg3, $arg4 );
14
15 $newObject = new MWBlankClass( $arg1, $arg2, $arg3, $arg4 );
16 $this->hideDeprecated( 'MWFunction::newObj' );
17 $this->assertEquals(
18 MWFunction::newObj( 'MWBlankClass', $args )->args,
19 $newObject->args
20 );
21 }
22 }
23
24 class MWBlankClass {
25
26 public $args = array();
27
28 function __construct( $arg1, $arg2, $arg3, $arg4 ) {
29 $this->args = array( $arg1, $arg2, $arg3, $arg4 );
30 }
31 }
32
33 class ExampleObject {
34 }