Wrap some long strings in tests/
authorReedy <reedy@wikimedia.org>
Sat, 26 Sep 2015 19:48:17 +0000 (20:48 +0100)
committerReedy <reedy@wikimedia.org>
Sat, 26 Sep 2015 20:01:59 +0000 (21:01 +0100)
Change-Id: I89d53c5051e5ee4bd8624df8ee2b25993090a7df

tests/TestsAutoLoader.php
tests/parser/parserTest.inc
tests/phpunit/MediaWikiPHPUnitTestListener.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php

index 8a81a64..093748d 100644 (file)
@@ -66,7 +66,8 @@ $wgAutoloadClasses += array(
        'TestRecentChangesHelper' => "$testDir/phpunit/includes/changes/TestRecentChangesHelper.php",
 
        # tests/phpunit/includes/content
-       'DummyContentHandlerForTesting' => "$testDir/phpunit/mocks/content/DummyContentHandlerForTesting.php",
+       'DummyContentHandlerForTesting' =>
+               "$testDir/phpunit/mocks/content/DummyContentHandlerForTesting.php",
        'DummyContentForTesting' => "$testDir/phpunit/mocks/content/DummyContentForTesting.php",
        'DummyNonTextContentHandler' => "$testDir/phpunit/mocks/content/DummyNonTextContentHandler.php",
        'DummyNonTextContent' => "$testDir/phpunit/mocks/content/DummyNonTextContent.php",
@@ -91,8 +92,10 @@ $wgAutoloadClasses += array(
        'PasswordTestCase' => "$testDir/phpunit/includes/password/PasswordTestCase.php",
 
        # tests/phpunit/includes/resourceloader
-       'ResourceLoaderImageModuleTest' => "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php",
-       'ResourceLoaderImageModuleTestable' => "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php",
+       'ResourceLoaderImageModuleTest' =>
+               "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php",
+       'ResourceLoaderImageModuleTestable' =>
+               "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php",
 
        # tests/phpunit/includes/specials
        'SpecialPageTestBase' => "$testDir/phpunit/includes/specials/SpecialPageTestBase.php",
index f429c30..0a7ebea 100644 (file)
@@ -729,7 +729,7 @@ class ParserTest {
                                )*
                                \}              # Close bracket
                        )
-            (?<value>
+                       (?<value>
                                (?:
                                        (?&qstr)                        # Quoted val
                                |
index 08463f1..dd606d8 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-class MediaWikiPHPUnitTestListener extends PHPUnit_TextUI_ResultPrinter implements PHPUnit_Framework_TestListener {
+class MediaWikiPHPUnitTestListener
+       extends PHPUnit_TextUI_ResultPrinter implements PHPUnit_Framework_TestListener {
 
        /**
         * @var string
index d0bc210..fc1887d 100644 (file)
@@ -100,7 +100,8 @@ class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase {
                                array(
                                        'class' => 'ResourceLoaderImageModule',
                                        'selectorWithoutVariant' => '.mw-ui-icon-{name}:after, .mw-ui-icon-{name}:before',
-                                       'selectorWithVariant' => '.mw-ui-icon-{name}-{variant}:after, .mw-ui-icon-{name}-{variant}:before',
+                                       'selectorWithVariant' =>
+                                               '.mw-ui-icon-{name}-{variant}:after, .mw-ui-icon-{name}-{variant}:before',
                                        'variants' => self::$commonImageVariants,
                                        'images' => self::$commonImageData,
                                ),
@@ -146,7 +147,10 @@ class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase {
         * @covers ResourceLoaderImageModule::getStyles
         */
        public function testGetStyles( $module, $expected ) {
-               $module = new ResourceLoaderImageModuleTestable( $module, __DIR__ . '/../../data/resourceloader' );
+               $module = new ResourceLoaderImageModuleTestable(
+                       $module,
+                       __DIR__ . '/../../data/resourceloader'
+               );
                $styles = $module->getStyles( $this->getResourceLoaderContext() );
                $this->assertEquals( $expected, $styles['all'] );
        }
index cc121ba..b4f1000 100644 (file)
@@ -15,9 +15,16 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
        protected function getTestImage( $name ) {
                $options = ResourceLoaderImageModuleTest::$commonImageData[$name];
                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
-               $allowedVariants = is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : array();
+               $allowedVariants = is_array( $options ) &&
+                       isset( $options['variants'] ) ? $options['variants'] : array();
                $variants = array_fill_keys( $allowedVariants, array( 'color' => 'red' ) );
-               return new ResourceLoaderImageTestable( $name, 'test', $fileDescriptor, $this->imagesPath, $variants );
+               return new ResourceLoaderImageTestable(
+                       $name,
+                       'test',
+                       $fileDescriptor,
+                       $this->imagesPath,
+                       $variants
+               );
        }
 
        public static function provideGetPath() {
@@ -86,7 +93,10 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
                $data = file_get_contents( $this->imagesPath . '/remove.svg' );
                $dataConstructive = file_get_contents( $this->imagesPath . '/remove_variantize.svg' );
                $this->assertEquals( $image->getImageData( $context, null, 'original' ), $data );
-               $this->assertEquals( $image->getImageData( $context, 'destructive', 'original' ), $dataConstructive );
+               $this->assertEquals(
+                       $image->getImageData( $context, 'destructive', 'original' ),
+                       $dataConstructive
+               );
                // Stub, since we don't know if we even have a SVG handler, much less what exactly it'll output
                $this->assertEquals( $image->getImageData( $context, null, 'rasterized' ), 'RASTERIZESTUB' );
 
index 41653fb..e8ca2a3 100644 (file)
@@ -75,7 +75,10 @@ class ResourceLoaderModuleTest extends ResourceLoaderTestCase {
                ) );
                $this->assertEquals(
                        $module->getScript( $context ),
-                       'mw.log.error("JavaScript parse error: Parse error: Unexpected token; token } expected in file \'input\' on line 3");',
+                       'mw.log.error(' .
+                               '"JavaScript parse error: Parse error: Unexpected token; ' .
+                               'token } expected in file \'input\' on line 3"' .
+                       ');',
                        'Replace invalid syntax with error logging'
                );
 
index 8cefec7..49e42b4 100644 (file)
@@ -61,7 +61,12 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase {
                        array( $params, new HashConfig( array( 'UseSiteJs' => false ) + $settings ), array(
                                'MediaWiki:Common.css' => array( 'type' => 'style' ),
                        ) ),
-                       array( $params, new HashConfig( array( 'UseSiteJs' => false, 'UseSiteCss' => false ) ), array() ),
+                       array( $params,
+                               new HashConfig(
+                                       array( 'UseSiteJs' => false, 'UseSiteCss' => false )
+                               ),
+                               array()
+                       ),
                );
        }