From 66cea66a681403372c8e7c288a608be361eee5b3 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 22 Feb 2013 00:58:19 +0100 Subject: [PATCH] phpcs: Naming of GlobalFunctions tests classes. 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 --- .../includes/GlobalFunctions/wfAssembleUrlTest.php | 5 ++--- .../phpunit/includes/GlobalFunctions/wfBCP47Test.php | 4 ++-- .../includes/GlobalFunctions/wfBaseConvertTest.php | 3 +-- .../includes/GlobalFunctions/wfBaseNameTest.php | 2 +- .../includes/GlobalFunctions/wfExpandUrlTest.php | 5 ++--- .../includes/GlobalFunctions/wfGetCallerTest.php | 12 ++++++------ .../GlobalFunctions/wfRemoveDotSegmentsTest.php | 5 ++--- .../GlobalFunctions/wfShorthandToIntegerTest.php | 2 +- .../includes/GlobalFunctions/wfTimestampTest.php | 3 +-- .../includes/GlobalFunctions/wfUrlencodeTest.php | 5 ++--- 10 files changed, 20 insertions(+), 26 deletions(-) diff --git a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php index 21fff68403..4bd8c6852a 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php @@ -1,9 +1,8 @@ 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 ) ); } } diff --git a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php index af784bdea0..67861eebc5 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php @@ -1,9 +1,8 @@ assertEquals( diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php index da6c936460..9d66d6b96f 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php @@ -1,6 +1,6 @@ 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 */ -- 2.20.1