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