wiki.techinc.nl/tests/phpunit/includes/MWFunctionTest.php
Kevin Israel 052f1fcf30 Deprecate MWFunction::call and ::callArray
These functions existed to work around a bug (fixed in PHP 5.3) and
a missing feature (added in PHP 5.2) in older versions of PHP;
therefore, they are no longer necessary.

Change-Id: Ifebbe3d449fc57fd83f8350c28f467605c1a07b7
2013-07-19 18:48:51 -04:00

30 lines
583 B
PHP

<?php
class MWFunctionTest extends MediaWikiTestCase {
function testNewObjFunction() {
$arg1 = 'Foo';
$arg2 = 'Bar';
$arg3 = array( 'Baz' );
$arg4 = new ExampleObject;
$args = array( $arg1, $arg2, $arg3, $arg4 );
$newObject = new MWBlankClass( $arg1, $arg2, $arg3, $arg4 );
$this->assertEquals(
MWFunction::newObj( 'MWBlankClass', $args )->args,
$newObject->args
);
}
}
class MWBlankClass {
public $args = array();
function __construct( $arg1, $arg2, $arg3, $arg4 ) {
$this->args = array( $arg1, $arg2, $arg3, $arg4 );
}
}
class ExampleObject {
}