From c33e34d8a53da96f4b3f1019990ffe2da8fff68b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 13 Jun 2022 15:24:11 +0000 Subject: [PATCH] Tests: Rename classes in `phpunit/tests/option/` per the naming conventions. https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53494 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/option/multisite.php | 2 +- tests/phpunit/tests/option/option.php | 28 +++++++++++-------- ...sanitize-option.php => sanitizeOption.php} | 2 +- tests/phpunit/tests/option/themeMods.php | 2 +- tests/phpunit/tests/option/userSettings.php | 5 ++-- ...oadAllOptions.php => wpLoadAlloptions.php} | 2 +- 6 files changed, 24 insertions(+), 17 deletions(-) rename tests/phpunit/tests/option/{sanitize-option.php => sanitizeOption.php} (98%) rename tests/phpunit/tests/option/{wpLoadAllOptions.php => wpLoadAlloptions.php} (97%) diff --git a/tests/phpunit/tests/option/multisite.php b/tests/phpunit/tests/option/multisite.php index 4f6d194b84..c2d4a10047 100644 --- a/tests/phpunit/tests/option/multisite.php +++ b/tests/phpunit/tests/option/multisite.php @@ -9,7 +9,7 @@ if ( is_multisite() ) : * @group ms-option * @group multisite */ - class Tests_Multisite_Option extends WP_UnitTestCase { + class Tests_Option_Multisite extends WP_UnitTestCase { public function test_from_same_site() { $key = __FUNCTION__ . '_1'; diff --git a/tests/phpunit/tests/option/option.php b/tests/phpunit/tests/option/option.php index 0ed9128421..3a16afed42 100644 --- a/tests/phpunit/tests/option/option.php +++ b/tests/phpunit/tests/option/option.php @@ -224,17 +224,6 @@ class Tests_Option_Option extends WP_UnitTestCase { delete_option( 'notoptions' ); } - public function data_option_autoloading() { - return array( - array( 'autoload_yes', 'yes', 'yes' ), - array( 'autoload_true', true, 'yes' ), - array( 'autoload_string', 'foo', 'yes' ), - array( 'autoload_int', 123456, 'yes' ), - array( 'autoload_array', array(), 'yes' ), - array( 'autoload_no', 'no', 'no' ), - array( 'autoload_false', false, 'no' ), - ); - } /** * Options should be autoloaded unless they were added with "no" or `false`. * @@ -249,4 +238,21 @@ class Tests_Option_Option extends WP_UnitTestCase { $actual = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s LIMIT 1", $name ) ); $this->assertSame( $expected, $actual->autoload ); } + + /** + * Data provider. + * + * @return array + */ + public function data_option_autoloading() { + return array( + array( 'autoload_yes', 'yes', 'yes' ), + array( 'autoload_true', true, 'yes' ), + array( 'autoload_string', 'foo', 'yes' ), + array( 'autoload_int', 123456, 'yes' ), + array( 'autoload_array', array(), 'yes' ), + array( 'autoload_no', 'no', 'no' ), + array( 'autoload_false', false, 'no' ), + ); + } } diff --git a/tests/phpunit/tests/option/sanitize-option.php b/tests/phpunit/tests/option/sanitizeOption.php similarity index 98% rename from tests/phpunit/tests/option/sanitize-option.php rename to tests/phpunit/tests/option/sanitizeOption.php index 80342fed8f..926b7885ca 100644 --- a/tests/phpunit/tests/option/sanitize-option.php +++ b/tests/phpunit/tests/option/sanitizeOption.php @@ -3,7 +3,7 @@ /** * @group option */ -class Tests_Sanitize_Option extends WP_UnitTestCase { +class Tests_Option_SanitizeOption extends WP_UnitTestCase { /** * Data provider to test all of the sanitize_option() case diff --git a/tests/phpunit/tests/option/themeMods.php b/tests/phpunit/tests/option/themeMods.php index 5c008e8a15..1529d79fef 100644 --- a/tests/phpunit/tests/option/themeMods.php +++ b/tests/phpunit/tests/option/themeMods.php @@ -3,7 +3,7 @@ /** * @group option */ -class Tests_Option_Theme_Mods extends WP_UnitTestCase { +class Tests_Option_ThemeMods extends WP_UnitTestCase { public function test_theme_mod_default() { $this->assertFalse( get_theme_mod( 'non_existent' ) ); diff --git a/tests/phpunit/tests/option/userSettings.php b/tests/phpunit/tests/option/userSettings.php index 46ab2a899a..38ef6bf67e 100644 --- a/tests/phpunit/tests/option/userSettings.php +++ b/tests/phpunit/tests/option/userSettings.php @@ -1,8 +1,9 @@