Merge "DatabaseMssql: Don't duplicate body of makeList()"
[mediawiki.git] / tests / phpunit / includes / utils / MWFunctionTest.php
blobf4d17999a0be81210f0a31526c1a5dae1eb3ba66
1 <?php
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;
13 $args = array( $arg1, $arg2, $arg3, $arg4 );
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
24 class MWBlankClass {
26 public $args = array();
28 function __construct( $arg1, $arg2, $arg3, $arg4 ) {
29 $this->args = array( $arg1, $arg2, $arg3, $arg4 );
33 class ExampleObject {