From c395d6fcd9b4660b79faf68435a12c85ee7c9ae4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 10 May 2020 12:07:49 +0000 Subject: [PATCH] Coding Standards: Rename some files and classes in `phpunit/tests/functions/` per the naming conventions. https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47780 602fd350-edb4-49c9-b593-d223f7449a82 --- .../functions/{canonical-charset.php => canonicalCharset.php} | 4 ++-- .../{_cleanup_header_comment.php => cleanupHeaderComment.php} | 2 +- tests/phpunit/tests/functions/deprecated.php | 4 ++-- tests/phpunit/tests/functions/getStatusHeaderDesc.php | 2 +- tests/phpunit/tests/functions/isNewDay.php | 2 +- tests/phpunit/tests/functions/isSerializedString.php | 2 +- tests/phpunit/tests/functions/numberFormatI18n.php | 2 +- tests/phpunit/tests/functions/pluginBasename.php | 2 +- tests/phpunit/tests/functions/sizeFormat.php | 2 +- tests/phpunit/tests/functions/underscoreReturn.php | 2 +- tests/phpunit/tests/functions/wpArraySliceAssoc.php | 2 +- tests/phpunit/tests/functions/wpAuthCheck.php | 2 +- .../tests/functions/{getArchives.php => wpGetArchives.php} | 2 +- tests/phpunit/tests/functions/wpGetMimeTypes.php | 2 +- .../tests/functions/{listFilter.php => wpListFilter.php} | 2 +- tests/phpunit/tests/functions/wpListUtil.php | 3 ++- tests/phpunit/tests/functions/wpRemoteFopen.php | 2 +- tests/phpunit/tests/functions/wpValidateBoolean.php | 2 +- 18 files changed, 21 insertions(+), 20 deletions(-) rename tests/phpunit/tests/functions/{canonical-charset.php => canonicalCharset.php} (93%) rename tests/phpunit/tests/functions/{_cleanup_header_comment.php => cleanupHeaderComment.php} (97%) rename tests/phpunit/tests/functions/{getArchives.php => wpGetArchives.php} (98%) rename tests/phpunit/tests/functions/{listFilter.php => wpListFilter.php} (99%) diff --git a/tests/phpunit/tests/functions/canonical-charset.php b/tests/phpunit/tests/functions/canonicalCharset.php similarity index 93% rename from tests/phpunit/tests/functions/canonical-charset.php rename to tests/phpunit/tests/functions/canonicalCharset.php index 107b6d94b9ea..bd128b769ef5 100644 --- a/tests/phpunit/tests/functions/canonical-charset.php +++ b/tests/phpunit/tests/functions/canonicalCharset.php @@ -1,12 +1,12 @@ assertEquals( 'UTF-8', _canonical_charset( 'utf-8' ) ); diff --git a/tests/phpunit/tests/functions/_cleanup_header_comment.php b/tests/phpunit/tests/functions/cleanupHeaderComment.php similarity index 97% rename from tests/phpunit/tests/functions/_cleanup_header_comment.php rename to tests/phpunit/tests/functions/cleanupHeaderComment.php index 0f1ceed3b016..825523bf7a39 100644 --- a/tests/phpunit/tests/functions/_cleanup_header_comment.php +++ b/tests/phpunit/tests/functions/cleanupHeaderComment.php @@ -6,7 +6,7 @@ * @ticket 8497 * @ticket 38101 */ -class Tests_Cleanup_Header_Comment extends WP_UnitTestCase { +class Tests_Functions_CleanupHeaderComment extends WP_UnitTestCase { /** * Test cleanup header of header comment. * diff --git a/tests/phpunit/tests/functions/deprecated.php b/tests/phpunit/tests/functions/deprecated.php index 2473972bb4d5..f42d3daa9282 100644 --- a/tests/phpunit/tests/functions/deprecated.php +++ b/tests/phpunit/tests/functions/deprecated.php @@ -5,10 +5,10 @@ * * @package WordPress * @subpackage Unit Tests - * @since 3.5 + * @since 3.5.0 * @group deprecated */ -class Test_Functions_Deprecated extends WP_UnitTestCase { +class Tests_Functions_Deprecated extends WP_UnitTestCase { /** * List of functions that have been passed through _deprecated_function() diff --git a/tests/phpunit/tests/functions/getStatusHeaderDesc.php b/tests/phpunit/tests/functions/getStatusHeaderDesc.php index 0b4ec3766150..956eae880f6c 100644 --- a/tests/phpunit/tests/functions/getStatusHeaderDesc.php +++ b/tests/phpunit/tests/functions/getStatusHeaderDesc.php @@ -7,7 +7,7 @@ * * @group functions.php */ -class Tests_Functions_get_status_header_desc extends WP_UnitTestCase { +class Tests_Functions_GetStatusHeaderDesc extends WP_UnitTestCase { /** * @dataProvider _status_strings diff --git a/tests/phpunit/tests/functions/isNewDay.php b/tests/phpunit/tests/functions/isNewDay.php index 629a6d3de56f..0bc459d52c2e 100644 --- a/tests/phpunit/tests/functions/isNewDay.php +++ b/tests/phpunit/tests/functions/isNewDay.php @@ -6,7 +6,7 @@ * * @group functions.php */ -class Tests_Functions_is_new_date extends WP_UnitTestCase { +class Tests_Functions_IsNewDate extends WP_UnitTestCase { /** * @ticket 46627 diff --git a/tests/phpunit/tests/functions/isSerializedString.php b/tests/phpunit/tests/functions/isSerializedString.php index 292765aab4f3..9a6bb4f7d702 100644 --- a/tests/phpunit/tests/functions/isSerializedString.php +++ b/tests/phpunit/tests/functions/isSerializedString.php @@ -6,7 +6,7 @@ * @group functions.php * @ticket 42870 */ -class Tests_Functions_Is_Serialized_String extends WP_UnitTestCase { +class Tests_Functions_IsSerializedString extends WP_UnitTestCase { /** * Data provider method for testing `is_serialized_string()`. diff --git a/tests/phpunit/tests/functions/numberFormatI18n.php b/tests/phpunit/tests/functions/numberFormatI18n.php index 8c514b319c49..db10ff50a8a6 100644 --- a/tests/phpunit/tests/functions/numberFormatI18n.php +++ b/tests/phpunit/tests/functions/numberFormatI18n.php @@ -6,7 +6,7 @@ * @group functions.php * @group i18n */ -class Tests_Functions_Number_Format_I18n extends WP_UnitTestCase { +class Tests_Functions_NumberFormatI18n extends WP_UnitTestCase { public function test_should_fall_back_to_number_format_when_wp_locale_is_not_set() { $locale = clone $GLOBALS['wp_locale']; $GLOBALS['wp_locale'] = null; diff --git a/tests/phpunit/tests/functions/pluginBasename.php b/tests/phpunit/tests/functions/pluginBasename.php index 42755f5f252e..e664d8fbd6fd 100644 --- a/tests/phpunit/tests/functions/pluginBasename.php +++ b/tests/phpunit/tests/functions/pluginBasename.php @@ -6,7 +6,7 @@ * @group functions.php * @group plugins */ -class Tests_Plugin_Basename extends WP_UnitTestCase { +class Tests_Functions_PluginBasename extends WP_UnitTestCase { /** * @var array diff --git a/tests/phpunit/tests/functions/sizeFormat.php b/tests/phpunit/tests/functions/sizeFormat.php index 0cf26511f1d2..7d473f23b957 100644 --- a/tests/phpunit/tests/functions/sizeFormat.php +++ b/tests/phpunit/tests/functions/sizeFormat.php @@ -6,7 +6,7 @@ * @group functions.php * @ticket 36635 */ -class Tests_Functions_Size_Format extends WP_UnitTestCase { +class Tests_Functions_SizeFormat extends WP_UnitTestCase { public function _data_size_format() { return array( array( array(), 0, false ), diff --git a/tests/phpunit/tests/functions/underscoreReturn.php b/tests/phpunit/tests/functions/underscoreReturn.php index 8c1d2e09622f..40222633f8a6 100644 --- a/tests/phpunit/tests/functions/underscoreReturn.php +++ b/tests/phpunit/tests/functions/underscoreReturn.php @@ -6,7 +6,7 @@ * * @group functions.php */ -class Tests_Functions_Underscore_Return extends WP_UnitTestCase { +class Tests_Functions_UnderscoreReturn extends WP_UnitTestCase { public function test__return_true() { $this->assertTrue( __return_true() ); diff --git a/tests/phpunit/tests/functions/wpArraySliceAssoc.php b/tests/phpunit/tests/functions/wpArraySliceAssoc.php index 73df5cb87ca0..bedf731771a7 100644 --- a/tests/phpunit/tests/functions/wpArraySliceAssoc.php +++ b/tests/phpunit/tests/functions/wpArraySliceAssoc.php @@ -8,7 +8,7 @@ * @covers wp_array_slice_assoc * @group functions.php */ -class Tests_Functions_WpArraySliceAssoc extends WP_UnitTestCase { +class Tests_Functions_wpArraySliceAssoc extends WP_UnitTestCase { /** * Test wp_array_slice_assoc(). diff --git a/tests/phpunit/tests/functions/wpAuthCheck.php b/tests/phpunit/tests/functions/wpAuthCheck.php index 32aafdddb1ca..a583d01606c1 100644 --- a/tests/phpunit/tests/functions/wpAuthCheck.php +++ b/tests/phpunit/tests/functions/wpAuthCheck.php @@ -5,7 +5,7 @@ * * @group functions.php */ -class Tests_Functions_WP_Auth_Check extends WP_UnitTestCase { +class Tests_Functions_wpAuthCheck extends WP_UnitTestCase { /** * Run with user not logged in. diff --git a/tests/phpunit/tests/functions/getArchives.php b/tests/phpunit/tests/functions/wpGetArchives.php similarity index 98% rename from tests/phpunit/tests/functions/getArchives.php rename to tests/phpunit/tests/functions/wpGetArchives.php index c771eece092a..7eaf356b068d 100644 --- a/tests/phpunit/tests/functions/getArchives.php +++ b/tests/phpunit/tests/functions/wpGetArchives.php @@ -7,7 +7,7 @@ 'echo' => 1, 'order' => 'DESC', ); */ -class Tests_Get_Archives extends WP_UnitTestCase { +class Tests_Functions_wpGetArchives extends WP_UnitTestCase { protected static $post_ids; protected $month_url; protected $year_url; diff --git a/tests/phpunit/tests/functions/wpGetMimeTypes.php b/tests/phpunit/tests/functions/wpGetMimeTypes.php index dec3ea73d656..8188ecd51831 100644 --- a/tests/phpunit/tests/functions/wpGetMimeTypes.php +++ b/tests/phpunit/tests/functions/wpGetMimeTypes.php @@ -5,7 +5,7 @@ * * @group functions.php */ -class Tests_wp_get_mime_types extends WP_UnitTestCase { +class Tests_Functions_wpGetMimeTypes extends WP_UnitTestCase { /** * @ticket 47701 diff --git a/tests/phpunit/tests/functions/listFilter.php b/tests/phpunit/tests/functions/wpListFilter.php similarity index 99% rename from tests/phpunit/tests/functions/listFilter.php rename to tests/phpunit/tests/functions/wpListFilter.php index 1e5c5533572e..4708cea16f3e 100644 --- a/tests/phpunit/tests/functions/listFilter.php +++ b/tests/phpunit/tests/functions/wpListFilter.php @@ -5,7 +5,7 @@ * * @group functions.php */ -class Tests_Functions_ListFilter extends WP_UnitTestCase { +class Tests_Functions_wpListFilter extends WP_UnitTestCase { var $object_list = array(); var $array_list = array(); diff --git a/tests/phpunit/tests/functions/wpListUtil.php b/tests/phpunit/tests/functions/wpListUtil.php index ef7ac45620bd..d6a014357cc4 100644 --- a/tests/phpunit/tests/functions/wpListUtil.php +++ b/tests/phpunit/tests/functions/wpListUtil.php @@ -3,7 +3,8 @@ /** * @group functions.php */ -class Tests_WP_List_Util extends WP_UnitTestCase { +class Tests_Functions_wpListUtil extends WP_UnitTestCase { + public function data_test_wp_list_pluck() { return array( 'arrays' => array( diff --git a/tests/phpunit/tests/functions/wpRemoteFopen.php b/tests/phpunit/tests/functions/wpRemoteFopen.php index b5627da800ee..3d52b82ba1be 100644 --- a/tests/phpunit/tests/functions/wpRemoteFopen.php +++ b/tests/phpunit/tests/functions/wpRemoteFopen.php @@ -4,7 +4,7 @@ * @group external-http * @group functions.php */ -class Tests_Functions_wp_remote_fopen extends WP_UnitTestCase { +class Tests_Functions_wpRemoteFopen extends WP_UnitTestCase { /** * @ticket 48845 diff --git a/tests/phpunit/tests/functions/wpValidateBoolean.php b/tests/phpunit/tests/functions/wpValidateBoolean.php index 833b73142575..848bccf2361e 100644 --- a/tests/phpunit/tests/functions/wpValidateBoolean.php +++ b/tests/phpunit/tests/functions/wpValidateBoolean.php @@ -6,7 +6,7 @@ * @covers ::wp_validate_boolean * @group functions.php */ -class Tests_Functions_WpValidateBoolean extends WP_UnitTestCase { +class Tests_Functions_wpValidateBoolean extends WP_UnitTestCase { /** * Provides test scenarios for all possible scenarios in wp_validate_boolean(). *