Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a `private` visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a `_` prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

git-svn-id: https://develop.svn.wordpress.org/trunk@52010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork
2021-11-04 15:22:47 +00:00
parent 80380cd374
commit 40ac5de838
327 changed files with 3656 additions and 3969 deletions

View File

@@ -405,7 +405,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 31869
*/
function test_truncated_index() {
public function test_truncated_index() {
global $wpdb;
if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
@@ -445,7 +445,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 36748
*/
function test_dont_downsize_text_fields() {
public function test_dont_downsize_text_fields() {
global $wpdb;
$result = dbDelta(
@@ -470,7 +470,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 36748
*/
function test_dont_downsize_blob_fields() {
public function test_dont_downsize_blob_fields() {
global $wpdb;
$result = dbDelta(
@@ -495,7 +495,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 36748
*/
function test_upsize_text_fields() {
public function test_upsize_text_fields() {
global $wpdb;
$result = dbDelta(
@@ -526,7 +526,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 36748
*/
function test_upsize_blob_fields() {
public function test_upsize_blob_fields() {
global $wpdb;
$result = dbDelta(
@@ -557,7 +557,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_query_with_backticks_does_not_throw_an_undefined_index_warning() {
public function test_query_with_backticks_does_not_throw_an_undefined_index_warning() {
global $wpdb;
$schema = "
@@ -582,7 +582,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 36948
*/
function test_spatial_indices() {
public function test_spatial_indices() {
global $wpdb;
$db_version = $wpdb->db_version();
@@ -643,7 +643,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_query_with_backticks_does_not_cause_a_query_to_alter_all_columns_and_indices_to_run_even_if_none_have_changed() {
public function test_query_with_backticks_does_not_cause_a_query_to_alter_all_columns_and_indices_to_run_even_if_none_have_changed() {
global $wpdb;
$schema = "
@@ -672,7 +672,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_index_with_a_reserved_keyword_can_be_created() {
public function test_index_with_a_reserved_keyword_can_be_created() {
global $wpdb;
$updates = dbDelta(
@@ -708,7 +708,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_wp_get_db_schema_does_no_alter_queries_on_existing_install() {
public function test_wp_get_db_schema_does_no_alter_queries_on_existing_install() {
$updates = dbDelta( wp_get_db_schema() );
$this->assertEmpty( $updates );
@@ -717,7 +717,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_key_and_index_and_fulltext_key_and_fulltext_index_and_unique_key_and_unique_index_indicies() {
public function test_key_and_index_and_fulltext_key_and_fulltext_index_and_unique_key_and_unique_index_indicies() {
global $wpdb;
$schema = "
@@ -755,7 +755,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_index_and_key_are_synonyms_and_do_not_recreate_indices() {
public function test_index_and_key_are_synonyms_and_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
@@ -779,7 +779,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 20263
*/
function test_indices_with_prefix_limits_are_created_and_do_not_recreate_indices() {
public function test_indices_with_prefix_limits_are_created_and_do_not_recreate_indices() {
global $wpdb;
$schema = "
@@ -813,7 +813,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34959
*/
function test_index_col_names_with_order_do_not_recreate_indices() {
public function test_index_col_names_with_order_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
@@ -837,7 +837,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34873
*/
function test_primary_key_with_single_space_does_not_recreate_index() {
public function test_primary_key_with_single_space_does_not_recreate_index() {
global $wpdb;
$updates = dbDelta(
@@ -861,7 +861,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34869
*/
function test_index_definitions_with_spaces_do_not_recreate_indices() {
public function test_index_definitions_with_spaces_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
@@ -885,7 +885,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34871
*/
function test_index_types_are_not_case_sensitive_and_do_not_recreate_indices() {
public function test_index_types_are_not_case_sensitive_and_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
@@ -909,7 +909,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34874
*/
function test_key_names_are_not_case_sensitive_and_do_not_recreate_indices() {
public function test_key_names_are_not_case_sensitive_and_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
@@ -934,7 +934,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34870
*/
function test_unchanged_key_lengths_do_not_recreate_index() {
public function test_unchanged_key_lengths_do_not_recreate_index() {
global $wpdb;
$updates = dbDelta(
@@ -959,7 +959,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 34870
*/
function test_changed_key_lengths_do_not_recreate_index() {
public function test_changed_key_lengths_do_not_recreate_index() {
global $wpdb;
$updates = dbDelta(
@@ -1043,7 +1043,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* @ticket 31679
*/
function test_column_type_change_with_hyphens_in_name() {
public function test_column_type_change_with_hyphens_in_name() {
global $wpdb;
$schema = "