From: Antoine Musso Date: Tue, 19 Feb 2013 21:00:09 +0000 (+0100) Subject: style X-Git-Tag: 1.31.0-rc.0~20640 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=593d873a8343521f937d62518a965314f09c50eb;p=lhc%2Fweb%2Fwiklou.git style 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 --- diff --git a/tests/phpunit/data/xmp/7.result.php b/tests/phpunit/data/xmp/7.result.php index 0efcfa363d..9aa867bcfb 100644 --- a/tests/phpunit/data/xmp/7.result.php +++ b/tests/phpunit/data/xmp/7.result.php @@ -1,52 +1,52 @@ - 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', + ), ); diff --git a/tests/phpunit/includes/PathRouterTest.php b/tests/phpunit/includes/PathRouterTest.php index f24cbab324..225918738f 100644 --- a/tests/phpunit/includes/PathRouterTest.php +++ b/tests/phpunit/includes/PathRouterTest.php @@ -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 ); } } diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php index ae003aedd5..31216b380e 100644 --- a/tests/phpunit/includes/StringUtilsTest.php +++ b/tests/phpunit/includes/StringUtilsTest.php @@ -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 ) { diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index ab39a0e143..dac5edb341 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -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" ) );