summaryrefslogtreecommitdiff
path: root/tests/phpunit/ResourceLoaderTestCase.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/ResourceLoaderTestCase.php')
-rw-r--r--tests/phpunit/ResourceLoaderTestCase.php23
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();
- }
-}