MediaWiki  REL1_22
MWFunctionTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class MWFunctionTest extends MediaWikiTestCase {
00004     public function testNewObjFunction() {
00005         $arg1 = 'Foo';
00006         $arg2 = 'Bar';
00007         $arg3 = array( 'Baz' );
00008         $arg4 = new ExampleObject;
00009 
00010         $args = array( $arg1, $arg2, $arg3, $arg4 );
00011 
00012         $newObject = new MWBlankClass( $arg1, $arg2, $arg3, $arg4 );
00013         $this->assertEquals(
00014             MWFunction::newObj( 'MWBlankClass', $args )->args,
00015             $newObject->args
00016         );
00017     }
00018 }
00019 
00020 class MWBlankClass {
00021 
00022     public $args = array();
00023 
00024     function __construct( $arg1, $arg2, $arg3, $arg4 ) {
00025         $this->args = array( $arg1, $arg2, $arg3, $arg4 );
00026     }
00027 }
00028 
00029 class ExampleObject {
00030 }