style
authorAntoine Musso <hashar@free.fr>
Tue, 19 Feb 2013 21:00:09 +0000 (22:00 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 20 Feb 2013 08:34:03 +0000 (08:34 +0000)
tests/phpunit/includes/StringUtilsTest.php:42:3
 - avoid function calls in a FOR loop test part

tests/phpunit/includes/PathRouterTest.php:155 to 165
 - fix space/tabs indenting
 - convert double quotes to single for consistency

tests/phpunit/data/xmp/7.result.php
 - reindent to use tabs instead of spaces
 - removed trailing whitespaces

tests/phpunit/includes/filebackend/FileBackendTest.php
 - spaces in indentation

Change-Id: I9c15803f961fc88b798ada3dd6c2b292c1de2143

tests/phpunit/data/xmp/7.result.php
tests/phpunit/includes/PathRouterTest.php
tests/phpunit/includes/StringUtilsTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php

index 0efcfa3..9aa867b 100644 (file)
@@ -1,52 +1,52 @@
 <?php
 $result = array (
-  'xmp-exif' => 
-  array (
-    'CameraOwnerName' => 'Me!',
-  ),
-  'xmp-general' => 
-  array (
-    'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9',
-    'ImageDescription' => 
-    array (
-      'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp',
-      '_type' => 'lang',
-    ),
-    'ObjectName' => 
-    array (
-      'x-default' => 'xmp core/xmp rights/cc ns test',
-      '_type' => 'lang',
-    ),
-    'DateTimeDigitized' => '2005:04:03',
-    'Software' => 'The one true editor: Vi (ok i used gimp)',
-    'Identifier' => 
-    array (
-      0 => 'http://example.com/identifierurl',
-      1 => 'urn:sha1:342524abcdef',
-      '_type' => 'ul',
-    ),
-    'Label' => 'Test image',
-    'DateTimeMetadata' => '2011:05:12',
-    'DateTime' => '2007:03:04 06:34:10',
-    'Nickname' => 'My little xmp test image',
-    'Rating' => '5',
-    'RightsCertificate' => 'http://example.com/rights-certificate/',
-    'Copyrighted' => 'True',
-    'CopyrightOwner' => 
-    array (
-      0 => 'Bawolff is copyright owner',
-      '_type' => 'ul',
-    ),
-    'UsageTerms' => 
-    array (
-      'x-default' => 'do whatever you want',
-      'en-gb' => 'Do whatever you want in british english',
-      '_type' => 'lang',
-    ),
-    'WebStatement' => 'http://example.com/web_statement',
-  ),
-  'xmp-deprecated' => 
-  array (
-    'Identifier' => 'http://example.com/identifierurl/wrong',
-  ),
+       'xmp-exif' =>
+       array (
+               'CameraOwnerName' => 'Me!',
+       ),
+       'xmp-general' =>
+       array (
+               'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9',
+               'ImageDescription' =>
+               array (
+                       'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp',
+                       '_type' => 'lang',
+               ),
+               'ObjectName' =>
+               array (
+                       'x-default' => 'xmp core/xmp rights/cc ns test',
+                       '_type' => 'lang',
+               ),
+               'DateTimeDigitized' => '2005:04:03',
+               'Software' => 'The one true editor: Vi (ok i used gimp)',
+               'Identifier' =>
+               array (
+                       0 => 'http://example.com/identifierurl',
+                       1 => 'urn:sha1:342524abcdef',
+                       '_type' => 'ul',
+               ),
+               'Label' => 'Test image',
+               'DateTimeMetadata' => '2011:05:12',
+               'DateTime' => '2007:03:04 06:34:10',
+               'Nickname' => 'My little xmp test image',
+               'Rating' => '5',
+               'RightsCertificate' => 'http://example.com/rights-certificate/',
+               'Copyrighted' => 'True',
+               'CopyrightOwner' =>
+               array (
+                       0 => 'Bawolff is copyright owner',
+                       '_type' => 'ul',
+               ),
+               'UsageTerms' =>
+               array (
+                       'x-default' => 'do whatever you want',
+                       'en-gb' => 'Do whatever you want in british english',
+                       '_type' => 'lang',
+               ),
+               'WebStatement' => 'http://example.com/web_statement',
+       ),
+       'xmp-deprecated' =>
+       array (
+               'Identifier' => 'http://example.com/identifierurl/wrong',
+       ),
 );
index f24cbab..2259187 100644 (file)
@@ -152,17 +152,17 @@ class PathRouterTest extends MediaWikiTestCase {
                $router->add( "/$2/$1", array( 'restricted-to-y' => '$2' ), array( '$2' => 'y' ) );
 
                foreach ( array(
-                                         "/Foo" => array( 'title' => "Foo" ),
-                                         "/Bar" => array( 'ping' => 'pong' ),
-                                         "/Baz" => array( 'marco' => 'polo' ),
-                                         "/asdf-foo" => array( 'title' => "qwerty-foo" ),
-                                         "/qwerty-bar" => array( 'title' => "asdf-bar" ),
-                                         "/a/Foo" => array( 'title' => "Foo" ),
-                                         "/asdf/Foo" => array( 'title' => "Foo" ),
-                                         "/qwerty/Foo" => array( 'title' => "Foo", 'qwerty' => 'qwerty' ),
-                                         "/baz/Foo" => array( 'title' => "Foo", 'unrestricted' => 'baz' ),
-                                         "/y/Foo" => array( 'title' => "Foo", 'restricted-to-y' => 'y' ),
-                                 ) as $path => $result ) {
+                                       '/Foo' => array( 'title' => 'Foo' ),
+                                       '/Bar' => array( 'ping' => 'pong' ),
+                                       '/Baz' => array( 'marco' => 'polo' ),
+                                       '/asdf-foo' => array( 'title' => 'qwerty-foo' ),
+                                       '/qwerty-bar' => array( 'title' => 'asdf-bar' ),
+                                       '/a/Foo' => array( 'title' => 'Foo' ),
+                                       '/asdf/Foo' => array( 'title' => 'Foo' ),
+                                       '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ),
+                                       '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ),
+                                       '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ),
+                               ) as $path => $result ) {
                        $this->assertEquals( $router->parse( $path ), $result );
                }
        }
index ae003ae..31216b3 100644 (file)
@@ -39,7 +39,8 @@ class StringUtilsTest extends MediaWikiTestCase {
         */
        function escaped( $string ) {
                $escaped = '';
-               for ( $i = 0; $i < strlen( $string ); $i++ ) {
+               $length = strlen( $string );
+               for ( $i = 0; $i < $length; $i++ ) {
                        $char = $string[$i];
                        $val = ord( $char );
                        if ( $val > 127 ) {
index ab39a0e..dac5edb 100644 (file)
@@ -1080,7 +1080,7 @@ class FileBackendTest extends MediaWikiTestCase {
                $cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "more file contents" );
                $cases[] = array(
                        array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
-                                "$base/unittest-cont1/e/a/z.txt" ),
+                               "$base/unittest-cont1/e/a/z.txt" ),
                        array( "contents xx", "contents xy", "contents xz" )
                );
 
@@ -1149,7 +1149,7 @@ class FileBackendTest extends MediaWikiTestCase {
                $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" );
                $cases[] = array(
                        array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
-                                "$base/unittest-cont1/e/a/z.txt" ),
+                               "$base/unittest-cont1/e/a/z.txt" ),
                        array( "contents xx", "contents xy", "contents xz" )
                );
 
@@ -1215,7 +1215,7 @@ class FileBackendTest extends MediaWikiTestCase {
                $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" );
                $cases[] = array(
                        array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
-                                "$base/unittest-cont1/e/a/z.txt" ),
+                               "$base/unittest-cont1/e/a/z.txt" ),
                        array( "contents xx", "contents xy", "contents xz" )
                );