Merge "resourceloader: Use 'phpunit' instead of 'test' as default target in PHPUnit...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 17 Nov 2015 04:15:09 +0000 (04:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 17 Nov 2015 04:15:09 +0000 (04:15 +0000)
includes/resourceloader/ResourceLoaderStartUpModule.php
tests/phpunit/ResourceLoaderTestCase.php

index e900200..9e840d5 100644 (file)
@@ -187,8 +187,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
 
                $resourceLoader = $context->getResourceLoader();
                $target = $context->getRequest()->getVal( 'target', 'desktop' );
-               // Bypass target filter if this request is from a unit test context. To prevent misuse in
-               // production, this is only allowed if testing is enabled server-side.
+               // Bypass target filter if this request is Special:JavaScriptTest.
+               // To prevent misuse in production, this is only allowed if testing is enabled server-side.
                $byPassTargetFilter = $this->getConfig()->get( 'EnableJavaScriptTest' ) && $target === 'test';
 
                $out = '';
index 325b20e..f22f4a1 100644 (file)
@@ -13,7 +13,7 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase {
                                'modules' => 'startup',
                                'only' => 'scripts',
                                'skin' => 'vector',
-                               'target' => 'test',
+                               'target' => 'phpunit',
                ) );
                $ctx = $this->getMockBuilder( 'ResourceLoaderContext' )
                        ->setConstructorArgs( array( $resourceLoader, $request ) )
@@ -67,7 +67,7 @@ class ResourceLoaderTestModule extends ResourceLoaderModule {
        protected $styles = '';
        protected $skipFunction = null;
        protected $isRaw = false;
-       protected $targets = array( 'test' );
+       protected $targets = array( 'phpunit' );
 
        public function __construct( $options = array() ) {
                foreach ( $options as $key => $value ) {