Merge "Implement mediawiki.confirmCloseWindow module"
[lhc/web/wiklou.git] / tests / phpunit / includes / 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->assertEquals(
17 MWFunction::newObj( 'MWBlankClass', $args )->args,
18 $newObject->args
19 );
20 }
21 }
22
23 class MWBlankClass {
24
25 public $args = array();
26
27 function __construct( $arg1, $arg2, $arg3, $arg4 ) {
28 $this->args = array( $arg1, $arg2, $arg3, $arg4 );
29 }
30 }
31
32 class ExampleObject {
33 }