Merge "Make image pagination not require a page load."
[lhc/web/wiklou.git] / tests / phpunit / includes / MWFunctionTest.php
1 <?php
2
3 class MWFunctionTest extends MediaWikiTestCase {
4 function testNewObjFunction() {
5 $arg1 = 'Foo';
6 $arg2 = 'Bar';
7 $arg3 = array( 'Baz' );
8 $arg4 = new ExampleObject;
9
10 $args = array( $arg1, $arg2, $arg3, $arg4 );
11
12 $newObject = new MWBlankClass( $arg1, $arg2, $arg3, $arg4 );
13 $this->assertEquals(
14 MWFunction::newObj( 'MWBlankClass', $args )->args,
15 $newObject->args
16 );
17 }
18 }
19
20 class MWBlankClass {
21
22 public $args = array();
23
24 function __construct( $arg1, $arg2, $arg3, $arg4 ) {
25 $this->args = array( $arg1, $arg2, $arg3, $arg4 );
26 }
27 }
28
29 class ExampleObject {
30 }