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
This commit is contained in:
Sergey Biryukov 2022-06-13 15:24:11 +00:00
parent cde9366b3a
commit c33e34d8a5
6 changed files with 24 additions and 17 deletions

View File

@ -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';

View File

@ -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' ),
);
}
}

View File

@ -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

View File

@ -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' ) );

View File

@ -1,8 +1,9 @@
<?php
/**
* @group 123456
* @group option
* @group user
*/
class Tests_User_Settings extends WP_UnitTestCase {
class Tests_Option_UserSettings extends WP_UnitTestCase {
protected $user_id;
public function set_up() {

View File

@ -4,7 +4,7 @@
*
* @group option
*/
class Tests_Option_WP_Load_Alloptions extends WP_UnitTestCase {
class Tests_Option_wpLoadAlloptions extends WP_UnitTestCase {
protected $alloptions = null;
public function tear_down() {