diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/ResourceLoaderTestCase.php | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/ResourceLoaderTestCase.php')
-rw-r--r-- | tests/phpunit/ResourceLoaderTestCase.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index f5f302e0..deecb31e 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -1,7 +1,12 @@ <?php abstract class ResourceLoaderTestCase extends MediaWikiTestCase { - protected static function getResourceLoaderContext( $lang = 'en' ) { + /** + * @param string $lang + * @param string $dir + * @return ResourceLoaderContext + */ + protected function getResourceLoaderContext( $lang = 'en', $dir = 'ltr' ) { $resourceLoader = new ResourceLoader(); $request = new FauxRequest( array( 'lang' => $lang, @@ -10,7 +15,14 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { 'skin' => 'vector', 'target' => 'test', ) ); - return new ResourceLoaderContext( $resourceLoader, $request ); + $ctx = $this->getMockBuilder( 'ResourceLoaderContext' ) + ->setConstructorArgs( array( $resourceLoader, $request ) ) + ->setMethods( array( 'getDirection' ) ) + ->getMock(); + $ctx->expects( $this->any() )->method( 'getDirection' )->will( + $this->returnValue( $dir ) + ); + return $ctx; } protected function setUp() { @@ -86,10 +98,3 @@ class ResourceLoaderTestModule extends ResourceLoaderModule { class ResourceLoaderFileModuleTestModule extends ResourceLoaderFileModule { } - -class ResourceLoaderWikiModuleTestModule extends ResourceLoaderWikiModule { - // Override expected via PHPUnit mocks and stubs - protected function getPages( ResourceLoaderContext $context ) { - return array(); - } -} |