phpcs: Naming of GlobalFunctions tests classes.
authorTimo Tijhof <ttijhof@wikimedia.org>
Thu, 21 Feb 2013 23:58:19 +0000 (00:58 +0100)
committerTimo Tijhof <ttijhof@wikimedia.org>
Fri, 22 Feb 2013 00:01:41 +0000 (01:01 +0100)
Code convensions:
 Class names should be UpperCamelCase.

And for PHPUnit:
 Class name should end in 'Test'.
 Class name should match file name.

Also made headers and spacing a bit more consistent.

Change-Id: Id7b6cec7e552240de44386b4759b57c2d37a39d1

tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php
tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php
tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php
tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php
tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php
tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php
tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php

index 21fff68..4bd8c68 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
- * Unit tests for wfAssembleUrl()
+ * Tests for wfAssembleUrl()
  */
-
-class wfAssembleUrl extends MediaWikiTestCase {
+class WfAssembleUrlTest extends MediaWikiTestCase {
        /** @dataProvider provideURLParts */
        public function testWfAssembleUrl( $parts, $output ) {
                $partsDump = print_r( $parts, true );
index 0b048b4..8df038d 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Unit tests for wfBCP47()
+ * Tests for wfBCP47()
  */
-class wfBCP47 extends MediaWikiTestCase {
+class WfBCP47Test extends MediaWikiTestCase {
        /**
         * test @see wfBCP47().
         * Please note the BCP explicitly state that language codes are case
index 1731fa0..10b62b3 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-
 /**
  * Tests for wfBaseConvert()
  */
-class wfBaseConvertTest extends MediaWikiTestCase {
+class WfBaseConvertTest extends MediaWikiTestCase {
        public static function provideSingleDigitConversions() {
                return array(
                        //      2    3    5    8   10   16   36
index f90c8d0..407be8d 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tests for wfBaseName()
  */
-class wfBaseName extends MediaWikiTestCase {
+class WfBaseNameTest extends MediaWikiTestCase {
        /**
         * @dataProvider providePaths
         */
index ac39c80..c1225e3 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
- * Unit tests for wfExpandUrl()
+ * Tests for wfExpandUrl()
  */
-
-class wfExpandUrl extends MediaWikiTestCase {
+class WfExpandUrlTest extends MediaWikiTestCase {
        /** @dataProvider provideExpandableUrls */
        public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto, $server, $canServer, $httpsMode, $message ) {
                // Fake $wgServer and $wgCanonicalServer
index 3b4ac65..58cf6b9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class wfGetCaller extends MediaWikiTestCase {
+class WfGetCallerTest extends MediaWikiTestCase {
 
        function testZero() {
                $this->assertEquals( __METHOD__, wfGetCaller( 1 ) );
@@ -11,7 +11,7 @@ class wfGetCaller extends MediaWikiTestCase {
        }
 
        function testOne() {
-               $this->assertEquals( "wfGetCaller::testOne", self::callerOne() );
+               $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() );
        }
 
        function intermediateFunction( $level = 2, $n = 0 ) {
@@ -22,14 +22,14 @@ class wfGetCaller extends MediaWikiTestCase {
        }
 
        function testTwo() {
-               $this->assertEquals( "wfGetCaller::testTwo", self::intermediateFunction() );
+               $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() );
        }
 
        function testN() {
-               $this->assertEquals( "wfGetCaller::testN", self::intermediateFunction( 2, 0 ) );
-               $this->assertEquals( "wfGetCaller::intermediateFunction", self::intermediateFunction( 1, 0 ) );
+               $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) );
+               $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) );
 
                for ( $i = 0; $i < 10; $i++ )
-                       $this->assertEquals( "wfGetCaller::intermediateFunction", self::intermediateFunction( $i + 1, $i ) );
+                       $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( $i + 1, $i ) );
        }
 }
index af784bd..67861ee 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 /**
- * Unit tests for wfRemoveDotSegments()
+ * Tests for wfRemoveDotSegments()
  */
-
-class wfRemoveDotSegments extends MediaWikiTestCase {
+class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
        /** @dataProvider providePaths */
        public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
                $this->assertEquals(
index da6c936..9d66d6b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class wfShorthandToIntegerTest extends MediaWikiTestCase {
+class WfShorthandToIntegerTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideABunchOfShorthands
         */
index 5fd0ed0..cf1830f 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-
 /*
  * Tests for wfTimestamp()
  */
-class wfTimestamp extends MediaWikiTestCase {
+class WfTimestampTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideNormalTimestamps
         */
index 285a2d6..77685d5 100644 (file)
@@ -1,11 +1,10 @@
 <?php
 /**
- * Tests for includes/GlobalFunctions.php -> wfUrlencode()
+ * Tests for wfUrlencode()
  *
  * The function only need a string parameter and might react to IIS7.0
  */
-
-class wfUrlencodeTest extends MediaWikiTestCase {
+class WfUrlencodeTest extends MediaWikiTestCase {
        #### TESTS ##############################################################
 
        /** @dataProvider provideURLS */